// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl 0x24(%rdi), %ecx
movl %ecx, %eax
subl 0x10(%rdi), %eax
cmpl %ecx, %eax
jae 0x3236
leaq 0x58(%rsp), %r14
leaq 0x20(%rsp), %r13
movl %eax, %ecx
leaq 0x28dd(%rip), %rbp      # 0x5733
movq %rdi, 0x30(%rsp)
movq %rcx, 0x88(%rsp)
movq 0x48(%rdi,%rcx,8), %rbx
movq %rbx, %r12
shrq $0x24, %r12
movq %rbx, %rax
shrq $0x18, %rax
andl $0x7ff, %eax            # imm = 0x7FF
movl %ebx, %ecx
shrl $0xc, %ecx
andl $0xfff, %ecx            # imm = 0xFFF
movl %ecx, 0x8(%rsp)
andl $0x7ff, %ebx            # imm = 0x7FF
movq 0x40048(%rdi), %rcx
shll $0x5, %eax
movq %r14, 0x48(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x497c
movq 0x48(%rsp), %rdi
cmpb $0x2a, (%rdi)
jne 0x31c3
incq %rdi
leaq 0x10(%rsp), %rsi
movl $0x8, %edx
callq 0x21c0
movq %rax, 0x40(%rsp)
movq 0x10(%rsp), %rdi
incq %rdi
movzbl -0x1(%rdi), %eax
cmpl $0x42, %eax
je 0x2edf
testl %eax, %eax
je 0x2f1e
cmpl $0x2b, %eax
jne 0x31c3
leaq -0x1(%rdi), %rax
movq %rax, 0x10(%rsp)
movsbl (%rdi), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x31c3
callq 0x2210
addl 0x40(%rsp), %eax
movq %rax, 0x40(%rsp)
cmpl $-0x1, 0x40(%rsp)
je 0x31c3
cmpl $0x0, 0x8(%rsp)
movq 0x30(%rsp), %r14
je 0x31fe
movq $0x0, 0x38(%rsp)
movl $0x0, 0xc(%rsp)
movq %r12, 0x90(%rsp)
testq %r12, %r12
je 0x31a0
xorl %r15d, %r15d
movq 0x40(%rsp), %rax
leal (%rax,%r15), %edx
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x454a
movq 0x10(%rsp), %rsi
leaq 0x27a1(%rip), %rdi      # 0x5721
xorl %eax, %eax
callq 0x2030
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x2f9e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2140
movq %r13, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
movl %ebx, %edi
shll $0x5, %edi
addq 0x40048(%r14), %rdi
movl $0x2b, %esi
xorl %edx, %edx
callq 0x21a0
movq %rax, %r13
movl %r15d, %eax
orl 0xc(%rsp), %eax
je 0x306e
cmpq $-0x1, %r13
je 0x306e
movq %rbx, %rcx
movq %rbp, %r12
movq 0x40048(%r14), %rax
shll $0x5, %ecx
movq (%rax,%rcx), %r14
leaq (%r14,%r13), %rdi
incq %rdi
callq 0x2210
movq 0x38(%rsp), %rcx
leal (%rcx,%r15), %r8d
addl %eax, %r8d
leaq 0x68(%rsp), %rbp
movq %rbp, %rdi
leaq 0x270d(%rip), %rsi      # 0x572b
movq %r13, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x254c
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x2190
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %r13
je 0x3059
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2140
movq %r12, %rbp
movq 0x30(%rsp), %r14
movq 0x90(%rsp), %r12
jmp 0x316e
testl %eax, %eax
je 0x30e2
movq 0x40048(%r14), %r14
movq 0x38(%rsp), %rax
leal (%rax,%r15), %edx
leaq 0x98(%rsp), %r13
movq %r13, %rdi
leaq 0x2624(%rip), %rsi      # 0x56b8
xorl %eax, %eax
callq 0x254c
movl %ebx, %eax
shll $0x5, %eax
movq (%r14,%rax), %rcx
movq 0x8(%r14,%rax), %r8
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2150
leaq 0x78(%rsp), %r14
movq %r14, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x20(%rsp), %r13
je 0x30ff
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x3106
movl %ebx, %esi
shll $0x5, %esi
addq 0x40048(%r14), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %r13
callq 0x20b0
jmp 0x316e
movups (%rcx), %xmm0
movups %xmm0, (%r14)
leaq 0x68(%rsp), %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x10(%rsp), %rdi
callq 0x2190
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x3144
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
movq 0x30(%rsp), %r14
je 0x316e
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x10(%rsp), %rsi
movq %rbp, %rdi
xorl %eax, %eax
callq 0x2030
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x3194
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2140
incl %r15d
cmpl %r15d, %r12d
jne 0x2f5e
movl 0xc(%rsp), %ecx
incl %ecx
movq 0x38(%rsp), %rax
addl %r12d, %eax
movq %rax, 0x38(%rsp)
movl %ecx, 0xc(%rsp)
cmpl 0x8(%rsp), %ecx
jne 0x2f52
jmp 0x31fe
movq 0x48(%rsp), %rdx
leaq 0x256e(%rip), %rdi      # 0x573d
movl %r12d, %esi
xorl %eax, %eax
callq 0x2030
movq 0x30(%rsp), %rax
movq 0x40048(%rax), %rax
shll $0x5, %ebx
movq (%rax,%rbx), %rdx
leaq 0x2556(%rip), %rdi      # 0x5749
movl 0x8(%rsp), %esi
xorl %eax, %eax
callq 0x2030
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %r14
cmpq %r14, %rdi
je 0x321a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x88(%rsp), %rcx
incq %rcx
movq 0x30(%rsp), %rdi
movl 0x24(%rdi), %eax
cmpq %rax, %rcx
jb 0x2e5b
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x58(%rsp), %r14
jmp 0x3295
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
leaq 0x58(%rsp), %r14
leaq 0x20(%rsp), %r13
je 0x3295
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2140
jmp 0x3295
jmp 0x3288
movq %rax, %rbx
leaq 0x58(%rsp), %r14
leaq 0x20(%rsp), %r13
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x32b6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2140
jmp 0x32b6
movq %rax, %rbx
leaq 0x58(%rsp), %r14
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x32cd
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x2220
nop