// File: besm6[P]pascal-re/dtran.cc
// Function: Dtran::prdata()
void prdata() {
    /*
     * Print data initializations in the form of assignments
     * if the source reference allows it.
     */
    for (uint cur = table_off - set_len; cur < table_off; ++cur) {
        uint64 word = memory[cur];
        uint len = word >> 36;
        uint from = (word >> 24) & 03777;
        uint cnt = (word >> 12) & 07777;
        uint to = word & 03777;
        std::string src = symtab[from];
        uint off = ~0;

        if (src[0] == '*') {
            char * end;
            off = strtol(src.c_str()+1, &end, 8);
            do {
                switch (*end) {
                case '\0': break;
                case '+':
                    if (isdigit(end[1]))
                        off += atoi(end+1);
                    else
                        off = ~0;
                    break;
                case 'B':
                    ++end;
                    continue;
                default:
                    off = ~0;
                    break;
                }
                break;
            } while (1);
        }
        if (off != ~0u) {
            for (uint tocnt = 0; tocnt < cnt; ++tocnt) {
                for (uint fromcnt = 0; fromcnt < len; ++fromcnt) {
                    printf(" ,XTA,%s\n", get_literal(off+fromcnt).c_str());
                    std::string temp;
                    size_t plus = symtab[to].find('+');
                    if (plus != std::string::npos && (tocnt || fromcnt)) {
                        uint was = atoi(symtab[to].c_str() + plus + 1);
                        temp = strprintf("%.*s+%d", plus, symtab[to].c_str(),
                                         was+ tocnt*len+fromcnt);
                    } else if (tocnt || fromcnt) {
                        temp = symtab[to] + strprintf("%+d", tocnt*len+fromcnt);
                    } else {
                        temp = symtab[to];
                    }
                    printf(" ,ATX,%s\n", temp.c_str());
                }
            }
        } else {
            printf(" %d,SET,%s\n", len, src.c_str());
            printf(" %d,   ,%s\n", cnt, symtab[to].c_str());
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x128(%rbp)
movl 0x24(%rcx), %eax
subl 0x10(%rcx), %eax
movl %eax, -0xc(%rbp)
movq -0x128(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x24(%rcx), %eax
jae 0x4699
movq -0x128(%rbp), %rdi
movl -0xc(%rbp), %eax
movq 0x48(%rdi,%rax,8), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
shrq $0x24, %rax
movl %eax, -0x1c(%rbp)
movl -0x15(%rbp), %eax
andl $0x7ff, %eax            # imm = 0x7FF
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %eax
shrl $0xc, %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, -0x24(%rbp)
movl -0x18(%rbp), %eax
andl $0x7ff, %eax            # imm = 0x7FF
movl %eax, -0x28(%rbp)
addq $0x40048, %rdi          # imm = 0x40048
movl -0x20(%rbp), %eax
movl %eax, %esi
callq 0x6380
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x30d0
movq -0x138(%rbp), %rdi
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %esi
callq 0x33b0
movq %rax, -0x130(%rbp)
jmp 0x423c
movq -0x130(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x4305
leaq -0x48(%rbp), %rdi
callq 0x30c0
movq %rax, %rdi
addq $0x1, %rdi
leaq -0x68(%rbp), %rsi
movl $0x8, %edx
callq 0x32d0
movl %eax, -0x4c(%rbp)
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x13c(%rbp)
testl %eax, %eax
je 0x42ae
jmp 0x4283
movl -0x13c(%rbp), %eax
subl $0x2b, %eax
je 0x42b0
jmp 0x4290
movl -0x13c(%rbp), %eax
subl $0x42, %eax
je 0x42e0
jmp 0x42ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x468e
jmp 0x42f5
movq -0x68(%rbp), %rax
movsbl 0x1(%rax), %edi
callq 0x3180
cmpl $0x0, %eax
je 0x42d7
movq -0x68(%rbp), %rdi
addq $0x1, %rdi
callq 0x3320
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x42de
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
jmp 0x42f5
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x42f7
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
jmp 0x4303
movb $0x1, %al
testb $0x1, %al
jne 0x4270
jmp 0x4303
jmp 0x4305
cmpl $-0x1, -0x4c(%rbp)
je 0x4608
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x4606
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x45f6
movq -0x128(%rbp), %rsi
movl -0x4c(%rbp), %edx
movl -0x70(%rbp), %eax
addl %eax, %edx
leaq -0x90(%rbp), %rdi
callq 0x6fd0
jmp 0x4352
leaq -0x90(%rbp), %rdi
callq 0x30c0
movq %rax, %rsi
leaq 0x442d(%rip), %rdi      # 0x8795
xorl %eax, %eax
callq 0x3040
jmp 0x4371
leaq -0x90(%rbp), %rdi
callq 0x3110
leaq -0xb0(%rbp), %rdi
callq 0x32b0
movq -0x128(%rbp), %rdi
addq $0x40048, %rdi          # imm = 0x40048
movl -0x28(%rbp), %eax
movl %eax, %esi
callq 0x6380
movq %rax, %rdi
movl $0x2b, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x3290
movq %rax, -0xb8(%rbp)
cmpq $-0x1, -0xb8(%rbp)
je 0x44c8
cmpl $0x0, -0x6c(%rbp)
jne 0x43d7
cmpl $0x0, -0x70(%rbp)
je 0x44c8
movq -0x128(%rbp), %rdi
addq $0x40048, %rdi          # imm = 0x40048
movq %rdi, -0x150(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %esi
callq 0x6380
movq %rax, %rdi
callq 0x30c0
movq -0xb8(%rbp), %rcx
leaq 0x1(%rax,%rcx), %rdi
callq 0x3320
movq -0x150(%rbp), %rdi
movl %eax, -0xbc(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x148(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %esi
callq 0x6380
movq %rax, %rdi
callq 0x30c0
movq -0x148(%rbp), %rdx
movq %rax, %rcx
movl -0xbc(%rbp), %r8d
movl -0x6c(%rbp), %eax
movl -0x1c(%rbp), %esi
imull %esi, %eax
addl %eax, %r8d
movl -0x70(%rbp), %eax
addl %eax, %r8d
leaq 0x4339(%rip), %rsi      # 0x879f
xorl %eax, %eax
leaq -0xe0(%rbp), %rdi
callq 0x34c0
jmp 0x4476
leaq -0xb0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x3260
leaq -0xe0(%rbp), %rdi
callq 0x3110
jmp 0x45ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3110
jmp 0x468e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x45e5
cmpl $0x0, -0x6c(%rbp)
jne 0x44d8
cmpl $0x0, -0x70(%rbp)
je 0x457f
movq -0x128(%rbp), %rdi
addq $0x40048, %rdi          # imm = 0x40048
movl -0x28(%rbp), %eax
movl %eax, %esi
callq 0x6380
movq %rax, -0x158(%rbp)
movl -0x6c(%rbp), %edx
movl -0x1c(%rbp), %eax
imull %eax, %edx
movl -0x70(%rbp), %eax
addl %eax, %edx
leaq 0x4220(%rip), %rsi      # 0x872c
xorl %eax, %eax
leaq -0x120(%rbp), %rdi
callq 0x34c0
jmp 0x451c
movq -0x158(%rbp), %rsi
leaq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x76e0
jmp 0x4538
leaq -0xb0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x3260
leaq -0x100(%rbp), %rdi
callq 0x3110
leaq -0x120(%rbp), %rdi
callq 0x3110
jmp 0x45aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x3110
jmp 0x45e5
movq -0x128(%rbp), %rdi
addq $0x40048, %rdi          # imm = 0x40048
movl -0x28(%rbp), %eax
movl %eax, %esi
callq 0x6380
movq %rax, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x3030
jmp 0x45a8
jmp 0x45aa
jmp 0x45ac
leaq -0xb0(%rbp), %rdi
callq 0x30c0
movq %rax, %rsi
leaq 0x41e5(%rip), %rdi      # 0x87a7
xorl %eax, %eax
callq 0x3040
jmp 0x45cb
leaq -0xb0(%rbp), %rdi
callq 0x3110
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x4329
leaq -0xb0(%rbp), %rdi
callq 0x3110
jmp 0x468e
jmp 0x45f8
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x4316
jmp 0x4677
movl -0x1c(%rbp), %eax
movl %eax, -0x15c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x30c0
movl -0x15c(%rbp), %esi
movq %rax, %rdx
leaq 0x4187(%rip), %rdi      # 0x87b1
xorl %eax, %eax
callq 0x3040
jmp 0x4633
movq -0x128(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, -0x160(%rbp)
addq $0x40048, %rdi          # imm = 0x40048
movl -0x28(%rbp), %eax
movl %eax, %esi
callq 0x6380
movq %rax, %rdi
callq 0x30c0
movl -0x160(%rbp), %esi
movq %rax, %rdx
leaq 0x4151(%rip), %rdi      # 0x87bd
xorl %eax, %eax
callq 0x3040
jmp 0x4675
jmp 0x4677
leaq -0x48(%rbp), %rdi
callq 0x3110
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x41a3
leaq -0x48(%rbp), %rdi
callq 0x3110
jmp 0x46a2
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x3370
nopl (%rax,%rax)