// File: /workspace/github_c_makefile_star2_O1/Liutos[P]Eloquent/compiler.c
// Function: compiler_do
int compiler_do(compiler_t *comp, ast_t *ast, ins_t *ins)
{
    assert(ins != NULL);
    int status = ERR;
    switch (ast->kind) {
        case AST_IDENTIFIER:
            status = compiler_do_ident(comp, ast, ins);
            break;
        case AST_INTEGER:
            status = compiler_do_int(comp, ast, ins);
            break;
        case AST_CONS:
            status = compiler_do_cons(comp, ast, ins);
            break;
        default :
            string_printf(comp->error, "Don't know how to compile: %d", ast->kind);
            return ERR;
    }
    ins_t *asm_ins = compiler_assemby(comp, ins);
    /* FIXME: 此处需要一个复制操作，将汇编后的指令复制到作为结果的ins变量中 */
    memcpy(ins, asm_ins, sizeof(ins_t));
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x5356
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl (%rsi), %edx
cmpl $0x1, %edx
je 0x5205
cmpl $0x5, %edx
je 0x51df
cmpl $0x4, %edx
jne 0x52a3
xorl %eax, %eax
leaq 0x4(%rsp), %rdx
movl %eax, (%rdx)
movq %rsp, %rcx
movl %eax, (%rcx)
movq 0x10(%r15), %rax
movq (%rax), %r12
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x5719
cmpl $0x1, %eax
jne 0x52dc
movl 0x4(%rsp), %edi
movl (%rsp), %esi
movq %r12, %rdx
callq 0x4810
jmp 0x51f0
movl 0x10(%r15), %edi
callq 0x267a
movq %rax, %rdi
callq 0x47f6
movq %rbx, %rdi
movq %rax, %rsi
callq 0x62ba
movl $0x1, %ebp
jmp 0x532c
movq 0x10(%r15), %r12
movl (%r12), %r8d
cmpl $0x4, %r8d
jne 0x52bc
movq 0x10(%r12), %rax
movq (%rax), %rsi
movq 0x28(%r14), %rdi
xorl %r13d, %r13d
xorl %edx, %edx
callq 0x5e20
movq 0x18(%r15), %r15
testq %rax, %rax
je 0x526a
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq *%rax
movl %eax, %ebp
jmp 0x532c
movq 0x10(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x5172
testl %eax, %eax
je 0x5262
movq 0x18(%r15), %r15
incl %r13d
testl %eax, %eax
je 0x532a
cmpl $0x1, (%r15)
je 0x5248
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x5172
testl %eax, %eax
je 0x532a
movl %r13d, %edi
callq 0x4680
movq %rbx, %rdi
movq %rax, %rsi
callq 0x62ba
callq 0x4698
jmp 0x51f0
movq 0x30(%r14), %rdi
leaq 0x247e(%rip), %rsi      # 0x772c
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x6197
jmp 0x5345
movq 0x30(%r14), %rdi
movl 0x4(%r12), %edx
movl 0x8(%r12), %ecx
leaq 0x2481(%rip), %rsi      # 0x7752
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x6197
jmp 0x532c
movq 0x10(%r14), %rdi
leaq 0x4(%rsp), %rdx
movq %rsp, %rcx
movq %r12, %rsi
callq 0x5719
cmpl $0x1, %eax
jne 0x5309
movl 0x4(%rsp), %edi
movl (%rsp), %esi
movq %r12, %rdx
callq 0x4713
jmp 0x51f0
movq 0x30(%r14), %rdi
movl 0x4(%r15), %edx
movl 0x8(%r15), %ecx
leaq 0x20b1(%rip), %rsi      # 0x73cd
xorl %ebp, %ebp
movq %r12, %r8
xorl %eax, %eax
callq 0x6197
jmp 0x532c
xorl %ebp, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5375
movups (%rax), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2388(%rip), %rdi      # 0x76e5
leaq 0x238d(%rip), %rsi      # 0x76f1
leaq 0x2391(%rip), %rcx      # 0x76fc
movl $0x158, %edx            # imm = 0x158
callq 0x2060