// File: /workspace/github_c_makefile_star2_O0/wtakuo[P]SVM/tvm.c
// Function: b2t
static void b2t (Bcode code[], Tcode tcode[], size_t codelen, 
                 const Tcode labels[]) {
    int i = 0;
    while (i < codelen) {
        tcode[i] = labels[code[i]];
        switch (code[i]) {
        case i_goto:
        case i_ifeq:
        case i_ifne:
        case i_iflt:
        case i_ifle:
        case i_ifgt:
        case i_ifge:
            tcode[i + 1] = (Tcode)B2INT(code[i + 1], code[i + 2]);
            tcode[i + 2] = NULL;
            i += 2;
            break;
        case i_giload:
        case i_gaload:
        case i_gistore:
        case i_gastore:
            /* tcode[i + 1] = (Tcode)((int)code[i+1] << 8 | (int)code[i+2]); */
            tcode[i + 1] = (Tcode)B2INT(code[i + 1], code[i + 2]);
            tcode[i + 2] = NULL;
            i += 2;
            break;
        case i_iload:
        case i_aload:
        case i_istore:
        case i_astore:
        case i_bipush:
        case i_icall:
        case i_acall:
        case i_ticall:
        case i_tacall:
        case i_sicall:
        case i_sacall:
            /* tcode[i+1] = (Tcode)((int)code[i+1]); */
            tcode[i + 1] = (Tcode)B1INT(code[i + 1]);
            i++;
            break;
        case i_sipush:
            tcode[i + 1] = (Tcode)((long)code[1] + (long)code[2] * 256);
            tcode[i + 2] = NULL;
            i += 2;
            break;
        }
        i++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x2e75
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdx
movslq -0x24(%rbp), %rcx
movzbl (%rdx,%rcx), %edx
movq (%rax,%rdx,8), %rdx
movq -0x10(%rbp), %rax
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzbl (%rax,%rcx), %eax
addl $-0x3, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x2f, %eax
ja 0x2e67
movq -0x30(%rbp), %rax
leaq 0x12d6(%rip), %rcx      # 0x4004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
shll $0x8, %eax
movq -0x8(%rbp), %rcx
movl -0x24(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movslq %eax, %rdx
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x2e67
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
shll $0x8, %eax
movq -0x8(%rbp), %rcx
movl -0x24(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movslq %eax, %rdx
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x2e67
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %edx
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2e67
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movzbl 0x2(%rax), %eax
shlq $0x8, %rax
addq %rax, %rdx
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2cdb
popq %rbp
retq
nopw (%rax,%rax)