// File: /workspace/github_cpp_makefile_star2_O1/0x0584[P]scmin-plus/src/builtin/builtin.cpp
// Function: builtin::_quasiquote(std::shared_ptr<sexpr> const&, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::shared_ptr<sexpr>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::shared_ptr<sexpr>>>>&)
sexpr_t builtin::_quasiquote(const sexpr_t& args, env_t& bindings) {
    if (args->length() != 1) {
        cerr << "quasiquote expects only one argument" << endl;
        return nullptr;
    }
    sexpr_t e, tail, walk;

    if (not args->car()->islist())
        return args->car();
    walk = args->car();
    while (not walk->isnil()) {
        sexpr_t tmp = cons(walk->car(), nil());

        if (walk->car()->islist() and walk->car()->car()->issymb()) {
            auto sy = any_cast<sexpr_text>(*walk->car()->car()->blob).text();
            if (sy == "unquote" or sy == "unquote-splicing") {
                tmp = builtin::_unquote(walk->car()->cdr(), bindings);
                if (sy == "unquote")
                    tmp = cons(tmp, nil());
            }
        }
        if (not e)
            tail = e = tmp;
        else {
            tail->setcdr(tmp);
            tail = tail->cdr();
        }
        walk = walk->cdr();
    }
    return e;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, -0xd0(%rbp)
movq %rsi, %rbx
movq %rdi, %r15
movq (%rsi), %rdi
callq 0x4ff4
cmpq $0x1, %rax
jne 0x78d0
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x80(%rbp)
movq (%rbx), %rsi
leaq -0x50(%rbp), %rdi
callq 0x634a
movq -0x50(%rbp), %rdi
callq 0x4cf4
movl %eax, %r14d
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x74e8
callq 0x4114
testb %r14b, %r14b
movq %r15, -0xa8(%rbp)
je 0x791e
movq (%rbx), %rsi
leaq -0x50(%rbp), %rdi
callq 0x634a
movq -0x50(%rbp), %r12
movq -0x48(%rbp), %r13
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x7521
callq 0x4114
leaq -0xc8(%rbp), %r15
movq %r12, %rdi
callq 0x4c7c
testb %al, %al
jne 0x792e
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x634a
movq %r15, %rdi
callq 0x51b8
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq %r15, %rdx
callq 0x52f5
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x756d
callq 0x4114
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
leaq -0x50(%rbp), %rbx
je 0x757f
callq 0x4114
movq %rbx, %rdi
movq %r12, %rsi
callq 0x634a
movq -0x50(%rbp), %rdi
callq 0x4cf4
movl %eax, %ebx
testb %al, %al
je 0x75cf
leaq -0xe0(%rbp), %rdi
movq %r12, %rsi
callq 0x634a
movq %r13, %r15
movq -0xe0(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x634a
movq -0xf0(%rbp), %rdi
callq 0x4ef8
movl %eax, %r13d
jmp 0x75d5
movq %r13, %r15
xorl %r13d, %r13d
testb %bl, %bl
leaq -0x90(%rbp), %rbx
je 0x7602
movq -0xe8(%rbp), %rdi
testq %rdi, %rdi
je 0x75f1
callq 0x4114
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x7602
callq 0x4114
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x7610
callq 0x4114
testb %r13b, %r13b
movq %r15, %r13
leaq -0xc8(%rbp), %r15
je 0x780a
leaq -0xa0(%rbp), %rdi
movq %r12, %rsi
callq 0x634a
movq -0xa0(%rbp), %rsi
movq %rbx, %rdi
callq 0x634a
movq %r15, %r14
movq -0x90(%rbp), %rax
movq (%rax), %rdi
callq 0x4695
movq %rax, %rbx
movq %r13, %r15
testq %rax, %rax
je 0x7997
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %r13
movq %r13, %rdi
callq 0x45ce
movb 0x20(%rbx), %al
movb %al, -0x30(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x38ac
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
leaq -0x90(%rbp), %rbx
movq %r15, %r13
je 0x76b4
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
movq %r14, %r15
je 0x76c8
callq 0x4114
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x76d9
callq 0x4114
movq %r15, %rdi
leaq 0xbc6d(%rip), %rsi      # 0x13350
callq 0x30a0
testl %eax, %eax
je 0x7703
movq %r15, %rdi
leaq 0xbc62(%rip), %rsi      # 0x13358
callq 0x30a0
testl %eax, %eax
jne 0x77e8
leaq -0xa0(%rbp), %rdi
movq %r12, %rsi
callq 0x634a
movq -0xa0(%rbp), %rsi
movq %rbx, %rdi
callq 0x627a
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
movq -0xd0(%rbp), %rdx
callq 0x732e
movaps -0x50(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x50(%rbp)
movq -0x68(%rbp), %rdi
movups %xmm0, -0x70(%rbp)
testq %rdi, %rdi
je 0x7751
callq 0x4114
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x775f
callq 0x4114
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x7770
callq 0x4114
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x7781
callq 0x4114
movq %r15, %rdi
leaq 0xbbc5(%rip), %rsi      # 0x13350
callq 0x30a0
testl %eax, %eax
jne 0x77e8
movq %rbx, %rdi
callq 0x51b8
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movq %rbx, %rdx
callq 0x52f5
movaps -0x50(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x50(%rbp)
movq -0x68(%rbp), %rdi
movups %xmm0, -0x70(%rbp)
testq %rdi, %rdi
je 0x77c9
callq 0x4114
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x77d7
callq 0x4114
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x77e8
callq 0x4114
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x780a
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31f0
cmpq $0x0, -0x60(%rbp)
je 0x7858
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x6218
movq -0x80(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x627a
movaps -0x50(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x50(%rbp)
movq -0x78(%rbp), %rdi
movaps %xmm0, -0x80(%rbp)
testq %rdi, %rdi
je 0x7848
callq 0x4114
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x7884
callq 0x4114
jmp 0x7884
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
callq 0x63b8
movq -0x60(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
movq %rbx, %rsi
callq 0x63b8
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x627a
movq -0x50(%rbp), %r12
movq -0x48(%rbp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
testq %r13, %r13
je 0x78ac
movq %r13, %rdi
callq 0x4114
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x78ba
callq 0x4114
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x78c8
callq 0x4114
movq %rbx, %r13
jmp 0x7528
movq 0x12711(%rip), %rbx     # 0x19fe8
leaq 0xba4d(%rip), %rsi      # 0x1332b
movl $0x24, %edx
movq %rbx, %rdi
callq 0x3210
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %r15, %rax
jmp 0x7985
movq (%rbx), %rsi
movq %r15, %rdi
callq 0x634a
xorl %r13d, %r13d
jmp 0x7952
movq -0x60(%rbp), %rax
movq -0xa8(%rbp), %rdx
movq %rax, (%rdx)
xorl %eax, %eax
movq %rax, 0x8(%rdx)
movq -0x58(%rbp), %rcx
movq %rax, -0x58(%rbp)
movq %rcx, 0x8(%rdx)
movq %rax, -0x60(%rbp)
testq %r13, %r13
je 0x795f
movq %r13, %rdi
callq 0x4114
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x796d
callq 0x4114
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
movq -0xa8(%rbp), %rbx
je 0x7982
callq 0x4114
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4667
jmp 0x79b3
jmp 0x79b3
movq %rax, %r14
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x79b6
callq 0x4114
jmp 0x79b6
movq %rax, %r14
xorl %r15d, %r15d
jmp 0x7b11
movq %r13, %r15
movq %rax, %r14
movq -0x88(%rbp), %rdi
jmp 0x79f5
jmp 0x7a01
movq %r13, %r15
movq %rax, %r14
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x79ee
callq 0x4114
jmp 0x79ee
movq %r13, %r15
movq %rax, %r14
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x7a07
callq 0x4114
jmp 0x7a07
movq %r13, %r15
movq %rax, %r14
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x7ad4
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31f0
jmp 0x7ad4
jmp 0x7a8d
movq %rax, %r14
jmp 0x7a7a
jmp 0x7ace
movq %rax, %rdi
callq 0x4085
movq %rax, %r14
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x7a90
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x31f0
jmp 0x7a90
jmp 0x7ab8
movq %rax, %r14
movq -0xe8(%rbp), %rdi
testq %rdi, %rdi
je 0x7a7a
callq 0x4114
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x7abe
callq 0x4114
jmp 0x7abe
movq %rax, %r14
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x7aa9
callq 0x4114
jmp 0x7aa9
movq %r13, %r15
movq %rax, %r14
movq -0x98(%rbp), %rdi
jmp 0x7ac2
jmp 0x7ace
jmp 0x7ace
jmp 0x7ace
movq %r13, %r15
movq %rax, %r14
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x7ad4
callq 0x4114
jmp 0x7ad4
movq %r13, %r15
movq %rax, %r14
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x7b11
callq 0x4114
jmp 0x7b11
jmp 0x7b0b
movq %r13, %r15
movq %rax, %r14
jmp 0x7b05
movq %r13, %r15
movq %rax, %r14
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x7b05
callq 0x4114
movq -0x48(%rbp), %rdi
jmp 0x7ad8
movq %r13, %r15
movq %rax, %r14
testq %r15, %r15
je 0x7b1e
movq %r15, %rdi
callq 0x4114
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x7b2c
callq 0x4114
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x7b3a
callq 0x4114
movq %r14, %rdi
callq 0x3310