// File: 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
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x1c8(%rbp)
movq %rdi, %rax
movq %rax, -0x1c0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x75d0
cmpq $0x1, %rax
je 0xcd86
movq 0x2129a(%rip), %rdi     # 0x2dff0
leaq 0x145b0(%rip), %rsi     # 0x2130d
callq 0x32c0
movq %rax, %rdi
movq 0x21224(%rip), %rsi     # 0x2df90
callq 0x32f0
movq -0x1c8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4570
jmp 0xd4bc
leaq -0x28(%rbp), %rdi
callq 0x6ef0
leaq -0x38(%rbp), %rdi
callq 0x6ef0
leaq -0x48(%rbp), %rdi
callq 0x6ef0
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0xb520
jmp 0xcdb8
leaq -0x58(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x72f0
movb %al, -0x1c9(%rbp)
jmp 0xcdd1
movb -0x1c9(%rbp), %al
xorb $-0x1, %al
movb %al, -0x1ca(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x4450
movb -0x1ca(%rbp), %al
testb $0x1, %al
jne 0xcdf4
jmp 0xce45
movq -0x10(%rbp), %rdi
callq 0x4400
movq -0x1c8(%rbp), %rdi
movq %rax, %rsi
callq 0xb520
jmp 0xce0e
movl $0x1, -0x68(%rbp)
jmp 0xd482
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xd49f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x4450
jmp 0xd49f
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
callq 0xb520
jmp 0xce5c
leaq -0x48(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4420
leaq -0x78(%rbp), %rdi
callq 0x4450
leaq -0x48(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x7270
movb %al, -0x1cb(%rbp)
jmp 0xce8b
movb -0x1cb(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xce9c
jmp 0xd46b
leaq -0x48(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x98(%rbp), %rdi
callq 0xb520
jmp 0xceb6
leaq -0xa8(%rbp), %rdi
callq 0x78f0
jmp 0xcec4
leaq -0x88(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x7a40
jmp 0xcee0
leaq -0xa8(%rbp), %rdi
callq 0x4450
leaq -0x98(%rbp), %rdi
callq 0x4450
leaq -0x48(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
movb $0x0, -0xd9(%rbp)
movb $0x0, -0xda(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0xb520
jmp 0xcf20
leaq -0xb8(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x72f0
movb %al, -0x1cc(%rbp)
jmp 0xcf3c
movb -0x1cc(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x1cd(%rbp)
jne 0xcf51
jmp 0xcfc0
leaq -0x48(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0xd8(%rbp), %rdi
callq 0xb520
jmp 0xcf6b
movb $0x1, -0xd9(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0xc8(%rbp), %rdi
callq 0xb520
jmp 0xcf8f
movb $0x1, -0xda(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x7500
movb %al, -0x1ce(%rbp)
jmp 0xcfb2
movb -0x1ce(%rbp), %al
movb %al, -0x1cd(%rbp)
jmp 0xcfc0
movb -0x1cd(%rbp), %al
movb %al, -0x1cf(%rbp)
testb $0x1, -0xda(%rbp)
jne 0xcfd7
jmp 0xcfe3
leaq -0xc8(%rbp), %rdi
callq 0x4450
testb $0x1, -0xd9(%rbp)
jne 0xcfee
jmp 0xcffa
leaq -0xd8(%rbp), %rdi
callq 0x4450
leaq -0xb8(%rbp), %rdi
callq 0x4450
movb -0x1cf(%rbp), %al
testb $0x1, %al
jne 0xd015
jmp 0xd39b
leaq -0x48(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x148(%rbp), %rdi
callq 0xb520
jmp 0xd02f
leaq -0x148(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x138(%rbp), %rdi
callq 0xb520
jmp 0xd04c
leaq -0x138(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x4520
movq %rax, -0x1d8(%rbp)
jmp 0xd069
movq -0x1d8(%rbp), %rsi
leaq -0x128(%rbp), %rdi
callq 0x44d0
jmp 0xd07e
leaq -0x100(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x3a60
jmp 0xd093
leaq -0x128(%rbp), %rdi
callq 0x4550
leaq -0x138(%rbp), %rdi
callq 0x4450
leaq -0x148(%rbp), %rdi
callq 0x4450
leaq 0x14274(%rip), %rsi     # 0x21332
leaq -0x100(%rbp), %rdi
callq 0x10e20
movb %al, -0x1d9(%rbp)
jmp 0xd0d2
movb -0x1d9(%rbp), %al
testb $0x1, %al
jne 0xd108
jmp 0xd0de
leaq 0x14255(%rip), %rsi     # 0x2133a
leaq -0x100(%rbp), %rdi
callq 0x10e20
movb %al, -0x1da(%rbp)
jmp 0xd0f9
movb -0x1da(%rbp), %al
testb $0x1, %al
jne 0xd108
jmp 0xd37c
leaq -0x48(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x178(%rbp), %rdi
callq 0xb520
jmp 0xd122
leaq -0x178(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x168(%rbp), %rdi
callq 0xb440
jmp 0xd13f
movq -0x18(%rbp), %rdx
leaq -0x158(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0xcbd0
jmp 0xd158
leaq -0x88(%rbp), %rdi
leaq -0x158(%rbp), %rsi
movq %rsi, -0x1e8(%rbp)
callq 0x4420
movq -0x1e8(%rbp), %rdi
callq 0x4450
leaq -0x168(%rbp), %rdi
callq 0x4450
leaq -0x178(%rbp), %rdi
callq 0x4450
leaq 0x14195(%rip), %rsi     # 0x21332
leaq -0x100(%rbp), %rdi
callq 0x10e20
movb %al, -0x1db(%rbp)
jmp 0xd1b1
movb -0x1db(%rbp), %al
testb $0x1, %al
jne 0xd1c0
jmp 0xd37a
leaq -0x198(%rbp), %rdi
callq 0x78f0
jmp 0xd1ce
leaq -0x188(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0x198(%rbp), %rdx
callq 0x7a40
jmp 0xd1ea
leaq -0x88(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x4420
leaq -0x188(%rbp), %rdi
callq 0x4450
leaq -0x198(%rbp), %rdi
callq 0x4450
jmp 0xd37a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xd240
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x4450
leaq -0x98(%rbp), %rdi
callq 0x4450
jmp 0xd49f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xd45d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xd2bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xd2a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
testb $0x1, -0xda(%rbp)
jne 0xd295
jmp 0xd2a1
leaq -0xc8(%rbp), %rdi
callq 0x4450
jmp 0xd2a3
testb $0x1, -0xd9(%rbp)
jne 0xd2ae
jmp 0xd2ba
leaq -0xd8(%rbp), %rdi
callq 0x4450
jmp 0xd2bc
leaq -0xb8(%rbp), %rdi
callq 0x4450
jmp 0xd45d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xd30d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xd301
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x4550
leaq -0x138(%rbp), %rdi
callq 0x4450
leaq -0x148(%rbp), %rdi
callq 0x4450
jmp 0xd45d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xd38a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xd352
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x4450
leaq -0x178(%rbp), %rdi
callq 0x4450
jmp 0xd38a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x4450
jmp 0xd38a
jmp 0xd37c
leaq -0x100(%rbp), %rdi
callq 0x31d0
jmp 0xd39b
leaq -0x100(%rbp), %rdi
callq 0x31d0
jmp 0xd45d
leaq -0x28(%rbp), %rdi
callq 0xb5c0
testb $0x1, %al
jne 0xd3c6
leaq -0x28(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xb5e0
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0xb5e0
jmp 0xd416
leaq -0x38(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
leaq -0x88(%rbp), %rsi
callq 0xb3d0
jmp 0xd3e0
leaq -0x38(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x1a8(%rbp), %rdi
callq 0xb440
jmp 0xd3fa
leaq -0x38(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x4420
leaq -0x1a8(%rbp), %rdi
callq 0x4450
leaq -0x48(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x1b8(%rbp), %rdi
callq 0xb440
jmp 0xd430
leaq -0x48(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x4420
leaq -0x1b8(%rbp), %rdi
callq 0x4450
leaq -0x88(%rbp), %rdi
callq 0x4450
jmp 0xce72
leaq -0x88(%rbp), %rdi
callq 0x4450
jmp 0xd49f
movq -0x1c8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xa6f0
movl $0x1, -0x68(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4450
leaq -0x38(%rbp), %rdi
callq 0x4450
leaq -0x28(%rbp), %rdi
callq 0x4450
jmp 0xd4bc
leaq -0x48(%rbp), %rdi
callq 0x4450
leaq -0x38(%rbp), %rdi
callq 0x4450
leaq -0x28(%rbp), %rdi
callq 0x4450
jmp 0xd4cc
movq -0x1c0(%rbp), %rax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x34f0
nopw %cs:(%rax,%rax)