// File: /workspace/github_c_makefile_star2_O3/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 0x52d3
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl (%rsi), %edx
cmpl $0x1, %edx
je 0x5180
cmpl $0x5, %edx
je 0x515a
cmpl $0x4, %edx
jne 0x51c3
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 0x5671
cmpl $0x1, %eax
jne 0x51fc
movl 0x4(%rsp), %edi
movl (%rsp), %esi
movq %r12, %rdx
callq 0x4798
jmp 0x516b
movl 0x10(%r15), %edi
callq 0x267a
movq %rax, %rdi
callq 0x477e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x61d6
movl $0x1, %ebp
jmp 0x5248
movq 0x10(%r15), %r12
movl (%r12), %r8d
cmpl $0x4, %r8d
jne 0x51dc
movq 0x10(%r12), %rax
movq (%rax), %rsi
movq 0x28(%r14), %rdi
xorl %r13d, %r13d
xorl %edx, %edx
callq 0x5d56
movq 0x18(%r15), %r15
testq %rax, %rax
je 0x5272
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq *%rax
movl %eax, %ebp
jmp 0x5248
movq 0x30(%r14), %rdi
leaq 0x255e(%rip), %rsi      # 0x772c
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x60c0
jmp 0x5261
movq 0x30(%r14), %rdi
movl 0x4(%r12), %edx
movl 0x8(%r12), %ecx
leaq 0x2561(%rip), %rsi      # 0x7752
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x60c0
jmp 0x5248
movq 0x10(%r14), %rdi
leaq 0x4(%rsp), %rdx
movq %rsp, %rcx
movq %r12, %rsi
callq 0x5671
cmpl $0x1, %eax
jne 0x5229
movl 0x4(%rsp), %edi
movl (%rsp), %esi
movq %r12, %rdx
callq 0x469b
jmp 0x516b
movq 0x30(%r14), %rdi
movl 0x4(%r15), %edx
movl 0x8(%r15), %ecx
leaq 0x2191(%rip), %rsi      # 0x73cd
xorl %ebp, %ebp
movq %r12, %r8
xorl %eax, %eax
callq 0x60c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x52f2
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
cmpl $0x1, (%r15)
jne 0x529d
xorl %ebp, %ebp
xorl %r13d, %r13d
movq 0x10(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x50ed
testl %eax, %eax
je 0x5248
incl %r13d
movq 0x18(%r15), %r15
cmpl $0x1, (%r15)
je 0x527d
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x50ed
testl %eax, %eax
je 0x52cc
movl %r13d, %edi
callq 0x4608
movq %rbx, %rdi
movq %rax, %rsi
callq 0x61d6
callq 0x4620
jmp 0x516b
xorl %ebp, %ebp
jmp 0x5248
leaq 0x240b(%rip), %rdi      # 0x76e5
leaq 0x2410(%rip), %rsi      # 0x76f1
leaq 0x2414(%rip), %rcx      # 0x76fc
movl $0x158, %edx            # imm = 0x158
callq 0x2060