// File: besm6[P]pascal-re/dtran.cc
// Function: Dtran::prsets()
void prsets() {
    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];
        if (len == 1 && src[0] == '*') {
            char * end;
            uint 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);
        }
        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 $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x70(%rbp)
movl 0x24(%rcx), %eax
subl 0x10(%rcx), %eax
movl %eax, -0xc(%rbp)
movq -0x70(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x24(%rcx), %eax
jae 0x48a5
movq -0x70(%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)
movq -0x18(%rbp), %rax
shrq $0x18, %rax
andq $0x7ff, %rax            # imm = 0x7FF
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
shrq $0xc, %rax
andq $0xfff, %rax            # imm = 0xFFF
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
andq $0x7ff, %rax            # 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
callq 0x30d0
cmpl $0x1, -0x1c(%rbp)
jne 0x482a
xorl %eax, %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x33b0
movq %rax, -0x78(%rbp)
jmp 0x4764
movq -0x78(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x482a
leaq -0x48(%rbp), %rdi
callq 0x30c0
movq %rax, %rdi
addq $0x1, %rdi
leaq -0x60(%rbp), %rsi
movl $0x8, %edx
callq 0x32d0
movl %eax, -0x64(%rbp)
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x7c(%rbp)
testl %eax, %eax
je 0x47d3
jmp 0x47a5
movl -0x7c(%rbp), %eax
subl $0x2b, %eax
je 0x47d5
jmp 0x47af
movl -0x7c(%rbp), %eax
subl $0x42, %eax
je 0x4805
jmp 0x4813
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x3110
jmp 0x48ae
jmp 0x481a
movq -0x60(%rbp), %rax
movsbl 0x1(%rax), %edi
callq 0x3180
cmpl $0x0, %eax
je 0x47fc
movq -0x60(%rbp), %rdi
addq $0x1, %rdi
callq 0x3320
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0x4803
movl $0xffffffff, -0x64(%rbp) # imm = 0xFFFFFFFF
jmp 0x481a
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x481c
movl $0xffffffff, -0x64(%rbp) # imm = 0xFFFFFFFF
jmp 0x4828
movb $0x1, %al
testb $0x1, %al
jne 0x4795
jmp 0x4828
jmp 0x482a
movl -0x1c(%rbp), %eax
movl %eax, -0x80(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x30c0
movl -0x80(%rbp), %esi
movq %rax, %rdx
leaq 0x3f6b(%rip), %rdi      # 0x87b1
xorl %eax, %eax
callq 0x3040
jmp 0x484f
movq -0x70(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, -0x84(%rbp)
addq $0x40048, %rdi          # imm = 0x40048
movl -0x28(%rbp), %eax
movl %eax, %esi
callq 0x6380
movq %rax, %rdi
callq 0x30c0
movl -0x84(%rbp), %esi
movq %rax, %rdx
leaq 0x3f38(%rip), %rdi      # 0x87bd
xorl %eax, %eax
callq 0x3040
jmp 0x488e
leaq -0x48(%rbp), %rdi
callq 0x3110
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x46d0
addq $0x90, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3370
nopw (%rax,%rax)