// File: /workspace/github_cpp_makefile_star2_O3/besm6[P]pascal-re/dtran.cc
// Function: Dtran::dump_sym(unsigned int, unsigned int)
void dump_sym(uint i, uint offset) {
        uint64 word = memory[i+offset];
        if ((word >> 15) == 0400) {
            uint val = word & 077777;
            // printf("C %5o: absolute %05o\n", i, (uint)word & 077777);
            if (val > 0100000-100)
                symtab[i] = strprintf("-%d", 0100000-val);
            else
                symtab[i] = strprintf(nooctal ? "%d" : "%oB", val);
        } else if ((word >> 15) == 0410) {
            uint off = word & 077777;
            // printf("C %5o: local offset %05o\n", i, off);
            symtab[i] = off < 010000 ?
                              strprintf("*%04oB", off)
                              : strprintf("*%05o", off);
            labels[off] = symtab[i];
        } else {
            if (word >> 42) {
                // The first char is not a space
                symtab[i] = get_text_word(word & 07777777700000000LL);
            } else if ((word & 00000400020000000LL) == 00000400020000000LL) {
                // Long ID
                uint loff = (word >> 24) & 03777;
                symtab[i] = get_text_word(memory[table_off + loff]);
            }
            if ((word & 057777777) == 043000000) {
                printf(" %s:,SUBP,\n", symtab[i].c_str());
            } else if ((word & 057000000) == 047000000) {
                printf(" %s:,LC,%d\n", symtab[i].c_str(),
                       (uint)word & 0777777);
            } else if (((word >> 24) & 077774000) == 04000 &&
                       (word & 077777777) < 0100000) {
                uint sym = (word >> 24) & 03777;
                uint off = word & 077777;
                int ioff = off >= 040000 ? -off : off;
                if (noequs) {
                    symtab[i] = strprintf("%s%+d",
                                          symtab[sym].c_str(), ioff);
                } else {
                    symtab[i] = gak(i);
                    printf(" %s:,EQU,%s%+d\n", symtab[i].c_str(),
                           symtab[sym].c_str(), ioff);
                }
            } else  {
                printf("C %5o: %016llo (%s) dunno\n", i, word, gak(i).c_str());
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movq %rdi, %rbx
addl %esi, %edx
movq 0x48(%rdi,%rdx,8), %r14
movq %r14, %rax
shrq $0xf, %rax
cmpq $0x108, %rax            # imm = 0x108
je 0x3a6c
cmpq $0x100, %rax            # imm = 0x100
jne 0x3af9
andl $0x7fff, %r14d          # imm = 0x7FFF
cmpl $0x7f9d, %r14d          # imm = 0x7F9D
jb 0x3b38
movl $0x8000, %edx           # imm = 0x8000
subl %r14d, %edx
leaq 0x1a8e(%rip), %rsi      # 0x54ce
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x254c
movl %ebp, %edi
shlq $0x5, %rdi
addq 0x40048(%rbx), %rdi
movq %r14, %rsi
callq 0x2190
movq (%r14), %rdi
jmp 0x3b78
movl %r14d, %edx
andl $0x7fff, %edx           # imm = 0x7FFF
cmpl $0x1000, %edx           # imm = 0x1000
leaq 0x1a50(%rip), %rax      # 0x54d2
leaq 0x1a50(%rip), %rsi      # 0x54d9
cmovbq %rax, %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x254c
movl %ebp, %r15d
shlq $0x5, %r15
movq 0x40048(%rbx), %rdi
addq %r15, %rdi
movq %r12, %rsi
callq 0x2190
movq (%r12), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3ad0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2140
addq 0x40048(%rbx), %r15
andl $0x7fff, %r14d          # imm = 0x7FFF
shll $0x5, %r14d
addq 0x40060(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x20b0
jmp 0x3c4a
movq %r14, %rax
shrq $0x2a, %rax
movl %ebp, %r15d
jne 0x3b98
movq %r14, %rax
notq %rax
movabsq $0x800400000, %rcx      # imm = 0x800400000
testq %rcx, %rax
jne 0x3be6
movq %r14, %rax
shrq $0x18, %rax
andl $0x7ff, %eax            # imm = 0x7FF
addl 0x24(%rbx), %eax
movq 0x48(%rbx,%rax,8), %rdx
jmp 0x3ba5
leaq 0x1b84(%rip), %rax      # 0x56c3
leaq 0x1b82(%rip), %rsi      # 0x56c8
cmpb $0x0, 0x42(%rbx)
cmovneq %rax, %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x254c
movl %ebp, %edi
shlq $0x5, %rdi
addq 0x40048(%rbx), %rdi
movq %r15, %rsi
callq 0x2190
movq (%r15), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3c4a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2140
jmp 0x3c4a
movabsq $0xffffff000000, %rdx   # imm = 0xFFFFFF000000
andq %r14, %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3622
movq %r15, %rdi
shlq $0x5, %rdi
addq 0x40048(%rbx), %rdi
movq %r12, %rsi
callq 0x2190
movq (%r12), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3be6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2140
movl %r14d, %eax
andl $0xbfffff, %eax         # imm = 0xBFFFFF
cmpl $0x8c0000, %eax         # imm = 0x8C0000
jne 0x3c14
movq 0x40048(%rbx), %rax
shlq $0x5, %r15
movq (%rax,%r15), %rsi
leaq 0x18d4(%rip), %rdi      # 0x54df
xorl %eax, %eax
callq 0x2030
jmp 0x3c4a
movl %r14d, %eax
andl $0xbc0000, %eax         # imm = 0xBC0000
cmpl $0x9c0000, %eax         # imm = 0x9C0000
jne 0x3c59
movq 0x40048(%rbx), %rax
shlq $0x5, %r15
movq (%rax,%r15), %rsi
andl $0x3ffff, %r14d         # imm = 0x3FFFF
leaq 0x18ab(%rip), %rdi      # 0x54eb
movl %r14d, %edx
xorl %eax, %eax
callq 0x2030
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movabsq $0xfff800ff8000, %rax   # imm = 0xFFF800FF8000
andq %r14, %rax
movabsq $0x800400000, %rcx      # imm = 0x800400000
addq $-0x400000, %rcx        # imm = 0xFFC00000
cmpq %rcx, %rax
jne 0x3ce3
movq %r14, %r13
shrq $0x18, %r13
andl $0x7fff, %r14d          # imm = 0x7FFF
movl %r14d, %r12d
negl %r12d
cmpl $0x4000, %r14d          # imm = 0x4000
cmovbl %r14d, %r12d
cmpb $0x1, 0x41(%rbx)
jne 0x3d10
andl $0x7ff, %r13d           # imm = 0x7FF
movq 0x40048(%rbx), %rax
shll $0x5, %r13d
movq (%rax,%r13), %rdx
leaq 0x1839(%rip), %rsi      # 0x54f7
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x254c
shlq $0x5, %r15
addq 0x40048(%rbx), %r15
movq %r15, %rdi
jmp 0x3a5c
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x3d82
movq (%r15), %rcx
leaq 0x180e(%rip), %rdi      # 0x550d
movl %ebp, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2030
jmp 0x3b75
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x3d82
shlq $0x5, %r15
movq 0x40048(%rbx), %rdi
addq %r15, %rdi
movq %r14, %rsi
callq 0x2190
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3d52
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x40048(%rbx), %rax
movq (%rax,%r15), %rsi
andl $0x7ff, %r13d           # imm = 0x7FF
shll $0x5, %r13d
movq (%rax,%r13), %rdx
leaq 0x178a(%rip), %rdi      # 0x54fd
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2030
jmp 0x3c4a