// File: /workspace/github_c_makefile_star2_O0/voithos[P]awl/src/eval.c
// Function: awlval_eval_inside_qexpr
awlval* awlval_eval_inside_qexpr(awlenv* e, awlval* v) {
    switch (v->type) {
        case AWLVAL_SEXPR:
        case AWLVAL_QEXPR:
        {
            for (int i = 0; i < v->count; i++) {
                // Special case for C-Expressions
                if (v->cell[i]->type == AWLVAL_CEXPR) {
                    awlval* cexpr = awlval_eval_cexpr(e, awlval_pop(v, i));
                    if (cexpr->type == AWLVAL_ERR) {
                        awlval_del(v);
                        return cexpr;
                    }

                    // Populate current container with result of CExpr
                    if (cexpr->type == AWLVAL_QEXPR) {
                        v = awlval_shift(v, cexpr, i);
                    } else {
                        v = awlval_insert(v, cexpr, i);
                    }
                } else {
                    v->cell[i] = awlval_eval_inside_qexpr(e, v->cell[i]);
                    if (v->cell[i]->type == AWLVAL_ERR) {
                        return awlval_take(v, i);
                    }
                }
            }
            return v;
            break;
        }

        case AWLVAL_EEXPR:
        {
            return awlval_eval(e, awlval_take(v, 0));
            break;

        }

        default:
            return v;
            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
addl $-0xb, %eax
subl $0x2, %eax
jb 0x7a94
jmp 0x7a83
movl -0x2c(%rbp), %eax
subl $0xd, %eax
je 0x7ba7
jmp 0x7bcc
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x7b9d
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0xe, (%rax)
jne 0x7b38
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x174b0
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x8170
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x7b03
movq -0x18(%rbp), %rdi
callq 0x16cf0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7bd4
movq -0x28(%rbp), %rax
cmpl $0xc, (%rax)
jne 0x7b22
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x176c0
movq %rax, -0x18(%rbp)
jmp 0x7b36
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x17600
movq %rax, -0x18(%rbp)
jmp 0x7b8d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x7a60
movq %rax, %rdx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x2, (%rax)
jne 0x7b8b
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x17560
movq %rax, -0x8(%rbp)
jmp 0x7bd4
jmp 0x7b8d
jmp 0x7b8f
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7a9b
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7bd4
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x17560
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x7770
movq %rax, -0x8(%rbp)
jmp 0x7bd4
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop