// File: besm6[P]pascal-re/dtran.cc
// Function: Dtran::prtext(bool)
void
prtext (bool litconst)
{
    uint32 addr = 0;
    uint32 limit = cmd_len;
    for (uint32 cur = addr; cur < limit; ++cur) {
        uint64 & opcode = memory[cur+3];
        mklabels(cur, opcode >> 24, litconst);
        mklabels(cur, opcode & 0xffffff, litconst);
    }
    if (nolabels) {
        puts(" /:,BSS,");
    }
    for (; addr < limit; ++addr) {
        uint64 opcode;
        if (!labels[addr].empty()) {
            if (nolabels) {
                printf(" :");
            } else {
                printf(" %s:", labels[addr].c_str());
            }
        } else
            putchar(' ');
        opcode = memory[addr+3];
        prinsn (addr, opcode >> 24);
        // Do not print the non-insn part of a word
        // if it looks like a placeholder
        opcode &= 0xffffff;
        if (opcode == 02200000) {
            opcode = memory[addr+3] >> 24;
            opcode &= 03700000;
            if (opcode != 03100000 &&
                labels[addr+1].empty()) {
                labels[addr+1] = " ";
            }
        } else {
            putchar(' ');
            prinsn (addr, opcode);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x10(%rbp)
movl 0x18(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x3d30
movq -0x30(%rbp), %rdi
movq %rdi, %rax
addq $0x48, %rax
movl -0x18(%rbp), %ecx
addl $0x3, %ecx
movl %ecx, %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x18(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rax
shrq $0x18, %rax
movl %eax, %edx
movb -0x9(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x64a0
movq -0x30(%rbp), %rdi
movl -0x18(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rax
andq $0xffffff, %rax         # imm = 0xFFFFFF
movl %eax, %edx
movb -0x9(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x64a0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x3cbf
movq -0x30(%rbp), %rax
testb $0x1, 0x40(%rax)
je 0x3d46
leaq 0x4852(%rip), %rdi      # 0x8593
callq 0x3300
jmp 0x3d48
movl -0x10(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x3ebc
movq -0x30(%rbp), %rdi
addq $0x40060, %rdi          # imm = 0x40060
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0x6380
movq %rax, %rdi
callq 0x3360
testb $0x1, %al
jne 0x3dbf
movq -0x30(%rbp), %rax
testb $0x1, 0x40(%rax)
je 0x3d8f
leaq 0x4816(%rip), %rdi      # 0x859c
movb $0x0, %al
callq 0x3040
jmp 0x3dbd
movq -0x30(%rbp), %rdi
addq $0x40060, %rdi          # imm = 0x40060
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0x6380
movq %rax, %rdi
callq 0x30c0
movq %rax, %rsi
leaq 0x47e9(%rip), %rdi      # 0x859f
movb $0x0, %al
callq 0x3040
jmp 0x3dc9
movl $0x20, %edi
callq 0x32c0
movq -0x30(%rbp), %rdi
movl -0x10(%rbp), %eax
addl $0x3, %eax
movl %eax, %eax
movq 0x48(%rdi,%rax,8), %rax
movq %rax, -0x28(%rbp)
movl -0x10(%rbp), %esi
movq -0x28(%rbp), %rax
shrq $0x18, %rax
movl %eax, %edx
callq 0x6880
movq -0x28(%rbp), %rax
andq $0xffffff, %rax         # imm = 0xFFFFFF
movq %rax, -0x28(%rbp)
cmpq $0x90000, -0x28(%rbp)   # imm = 0x90000
jne 0x3e90
movq -0x30(%rbp), %rax
movl -0x10(%rbp), %ecx
addl $0x3, %ecx
movl %ecx, %ecx
movq 0x48(%rax,%rcx,8), %rax
shrq $0x18, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
andq $0xf8000, %rax          # imm = 0xF8000
movq %rax, -0x28(%rbp)
cmpq $0xc8000, -0x28(%rbp)   # imm = 0xC8000
je 0x3e8e
movq -0x30(%rbp), %rdi
addq $0x40060, %rdi          # imm = 0x40060
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x6380
movq %rax, %rdi
callq 0x3360
testb $0x1, %al
jne 0x3e65
jmp 0x3e8e
movq -0x30(%rbp), %rdi
addq $0x40060, %rdi          # imm = 0x40060
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x6380
movq %rax, %rdi
leaq 0x490a(%rip), %rsi      # 0x8793
callq 0x32a0
jmp 0x3eac
movl $0x20, %edi
callq 0x32c0
movq -0x30(%rbp), %rdi
movl -0x10(%rbp), %esi
movq -0x28(%rbp), %rax
movl %eax, %edx
callq 0x6880
jmp 0x3eae
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x3d48
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)