// File: /workspace/github_c_makefile_star2_O0/neosploit[P]compiler/ast_free.c
// Function: ast_expression_free
static void ast_expression_free(Expression* expression) {

    if (expression->next) ast_expression_free(expression->next);

    switch (expression->tag) {
        case EXPRESSION_BINARY:
            ast_expression_free(expression->binary.left_expression);
            ast_expression_free(expression->binary.right_expression);

            break;
        case EXPRESSION_UNARY:
            ast_expression_free(expression->unary.expression);

            break;
        case EXPRESSION_VARIABLE:
            ast_variable_free(expression->variable.variable);

            break;
        case EXPRESSION_FUNCTION_CALL:
            ast_id_free(expression->function_call.id);
            ast_expression_free(expression->function_call.expressions);

            break;
        case EXPRESSION_LENGTH:
            ast_expression_free(expression->length.expression);

            break;
        case EXPRESSION_NEW:
            ast_expression_free(expression->new.expression);

            break;
        case EXPRESSION_CONSTANT:
            ast_constant_free(expression->constant.constant);

            break;
        case EXPRESSION_ENCLOSED:
            ast_expression_free(expression->enclosed.expression);

            break;
        case EXPRESSION_SETLIST:
            if (expression->setlist.expression) ast_expression_free(expression->setlist.expression);

            break;
        case EXPRESSION_LIMITS:
            ast_constant_free(expression->limits.lower_limit);
            ast_constant_free(expression->limits.upper_limit);

            break;
        case EXPRESSION_LIMITS_ID:
            ast_id_free(expression->limits_id.id);

            break;
        case EXPRESSION_ITER_SPACE:
            ast_expression_free(expression->iter_space.initial_expression);
            ast_expression_free(expression->iter_space.final_expression);
    }

    free(expression);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x10044
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x10020
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x10(%rbp)
subq $0xb, %rax
ja 0x1016d
movq -0x10(%rbp), %rax
leaq 0x12610(%rip), %rcx     # 0x22674
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10020
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x10020
jmp 0x1016d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10020
jmp 0x1016d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10260
jmp 0x1016d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xffe0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10020
jmp 0x1016d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10020
jmp 0x1016d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10020
jmp 0x1016d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10320
jmp 0x1016d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10020
jmp 0x1016d
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x10126
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10020
jmp 0x1016d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10320
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10320
jmp 0x1016d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xffe0
jmp 0x1016d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10020
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x10020
movq -0x8(%rbp), %rdi
callq 0x7290
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)