// File: /workspace/github_cpp_makefile_star2_O3/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 $0xa8, %rsp
movq %rdx, -0xd0(%rbp)
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rdi
callq 0x4fb6
cmpq $0x1, %rax
jne 0x76c8
movq %r14, -0x98(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movaps %xmm0, -0x90(%rbp)
movq (%rbx), %rsi
leaq -0x60(%rbp), %rdi
callq 0x628e
movq -0x60(%rbp), %rdi
callq 0x4cec
movl %eax, %r14d
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x732a
callq 0x4104
testb %r14b, %r14b
je 0x7716
movq (%rbx), %rsi
leaq -0x60(%rbp), %rdi
callq 0x628e
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %r13
movq -0x8(%rax), %rbx
leaq -0x60(%rbp), %r14
leaq -0xc8(%rbp), %r15
leaq -0x38(%rbp), %r12
movq %r13, %rdi
callq 0x4c74
testb %al, %al
jne 0x7727
movq %r14, %rdi
movq %r13, %rsi
callq 0x628e
movq %r15, %rdi
callq 0x514c
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5289
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x739d
callq 0x4104
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x73ab
callq 0x4104
movq %r14, %rdi
movq %r13, %rsi
callq 0x628e
movq -0x60(%rbp), %rdi
callq 0x4cec
testb %al, %al
je 0x740a
movq %r12, %rdi
movq %r13, %rsi
callq 0x628e
movq -0x38(%rbp), %rsi
movq %r15, %rdi
callq 0x628e
movq -0xc8(%rbp), %rdi
callq 0x4ed6
movl %eax, %r12d
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x73fa
callq 0x4104
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x740d
callq 0x4104
jmp 0x740d
xorl %r12d, %r12d
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x741b
callq 0x4104
testb %r12b, %r12b
leaq -0x38(%rbp), %r12
je 0x75f2
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
callq 0x628e
movq -0xa8(%rbp), %rsi
movq %r12, %rdi
callq 0x628e
movq -0x38(%rbp), %rax
movq (%rax), %rdi
callq 0x4696
movq %rax, %r12
testq %rax, %rax
je 0x778f
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x45ca
movb 0x20(%r12), %al
movb %al, -0x40(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x389c
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
leaq -0x38(%rbp), %r12
je 0x74aa
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x74b8
callq 0x4104
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x74c9
callq 0x4104
movq %r15, %rdi
leaq 0xbe7d(%rip), %rsi      # 0x13350
callq 0x30a0
testl %eax, %eax
je 0x74f3
movq %r15, %rdi
leaq 0xbe72(%rip), %rsi      # 0x13358
callq 0x30a0
testl %eax, %eax
jne 0x75d0
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
callq 0x628e
movq -0xa8(%rbp), %rsi
movq %r12, %rdi
callq 0x61be
movq %r14, %rdi
movq %r12, %rsi
movq -0xd0(%rbp), %rdx
callq 0x7166
movaps -0x60(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x60(%rbp)
movq -0x78(%rbp), %rdi
movups %xmm0, -0x80(%rbp)
testq %rdi, %rdi
je 0x754e
callq 0x4104
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x754e
callq 0x4104
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x755c
callq 0x4104
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x756d
callq 0x4104
movq %r15, %rdi
leaq 0xbdd9(%rip), %rsi      # 0x13350
callq 0x30a0
testl %eax, %eax
jne 0x75d0
movq %r12, %rdi
callq 0x514c
movq %r14, %rdi
leaq -0x80(%rbp), %rsi
movq %r12, %rdx
callq 0x5289
movaps -0x60(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x60(%rbp)
movq -0x78(%rbp), %rdi
movups %xmm0, -0x80(%rbp)
testq %rdi, %rdi
je 0x75c2
callq 0x4104
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x75c2
callq 0x4104
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x75d0
callq 0x4104
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x75f2
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31f0
cmpq $0x0, -0x70(%rbp)
je 0x764b
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x615c
movq -0x90(%rbp), %rsi
movq %r14, %rdi
callq 0x61be
movaps -0x60(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x60(%rbp)
movq -0x88(%rbp), %rdi
movaps %xmm0, -0x90(%rbp)
testq %rdi, %rdi
je 0x767d
callq 0x4104
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x767d
callq 0x4104
jmp 0x767d
movq -0x80(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %r12
movq %r12, %rdi
leaq -0x78(%rbp), %rsi
callq 0x62fc
movq -0x70(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
movq %r12, %rsi
callq 0x62fc
movq %r14, %rdi
movq %r13, %rsi
callq 0x61be
movq -0x60(%rbp), %r13
movq -0x58(%rbp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
testq %rbx, %rbx
je 0x76b2
movq %rbx, %rdi
callq 0x4104
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x76b2
callq 0x4104
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x76c0
callq 0x4104
movq %r12, %rbx
jmp 0x7356
movq 0x12919(%rip), %rbx     # 0x19fe8
leaq 0xbc55(%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, (%r14)
movq %r14, %rax
jmp 0x777d
movq (%rbx), %rsi
movq -0x98(%rbp), %rdi
callq 0x628e
jmp 0x7754
movq -0x70(%rbp), %rax
movq -0x98(%rbp), %rdx
movq %rax, (%rdx)
movq -0x68(%rbp), %rax
xorl %ecx, %ecx
movq %rcx, -0x68(%rbp)
movq %rax, 0x8(%rdx)
movq %rcx, -0x70(%rbp)
testq %rbx, %rbx
je 0x7754
movq %rbx, %rdi
callq 0x4104
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x7765
callq 0x4104
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
movq -0x98(%rbp), %rbx
je 0x777a
callq 0x4104
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4668
jmp 0x77ad
jmp 0x77ad
movq %rax, %r14
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
jne 0x78e6
jmp 0x78eb
movq %rax, %r14
jmp 0x78eb
movq %rax, %r14
movq -0x30(%rbp), %rdi
jmp 0x77dd
jmp 0x77e9
movq %rax, %r14
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x77d6
callq 0x4104
jmp 0x77d6
movq %rax, %r14
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x77ec
callq 0x4104
jmp 0x77ec
movq %rax, %r14
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x78aa
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31f0
jmp 0x78aa
jmp 0x786f
movq %rax, %r14
jmp 0x785f
jmp 0x78a7
movq %rax, %rdi
callq 0x4075
movq %rax, %r14
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x7872
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x31f0
jmp 0x7872
jmp 0x7894
movq %rax, %r14
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x785f
callq 0x4104
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x7897
callq 0x4104
jmp 0x7897
movq %rax, %r14
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x7885
callq 0x4104
jmp 0x7885
movq %rax, %r14
movq -0xa0(%rbp), %rdi
jmp 0x789b
jmp 0x78a7
jmp 0x78a7
jmp 0x78a7
movq %rax, %r14
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x78aa
callq 0x4104
jmp 0x78aa
movq %rax, %r14
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x78de
callq 0x4104
jmp 0x78de
jmp 0x78db
movq %rax, %r14
jmp 0x78d5
movq %rax, %r14
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x78d5
callq 0x4104
movq -0x58(%rbp), %rdi
jmp 0x78ae
movq %rax, %r14
testq %rbx, %rbx
je 0x78eb
movq %rbx, %rdi
callq 0x4104
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x78fc
callq 0x4104
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x790a
callq 0x4104
movq %r14, %rdi
callq 0x3310