// File: /workspace/github_cpp_makefile_star2_O2/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 0x3730
cmpq $0x100, %rax            # imm = 0x100
jne 0x37a5
andl $0x7fff, %r14d          # imm = 0x7FFF
cmpl $0x7f9d, %r14d          # imm = 0x7F9D
jb 0x37e0
movl $0x8000, %edx           # imm = 0x8000
subl %r14d, %edx
leaq 0x1dca(%rip), %rsi      # 0x54ce
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x23cc
movl %ebp, %edi
shlq $0x5, %rdi
addq 0x40048(%rbx), %rdi
movq %r14, %rsi
callq 0x21a0
movq %r14, %rdi
jmp 0x3820
andl $0x7fff, %r14d          # imm = 0x7FFF
cmpl $0x1000, %r14d          # imm = 0x1000
leaq 0x1d8d(%rip), %rax      # 0x54d2
leaq 0x1d8d(%rip), %rsi      # 0x54d9
cmovbq %rax, %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x23cc
movl %ebp, %r12d
shlq $0x5, %r12
movq 0x40048(%rbx), %rdi
addq %r12, %rdi
movq %r15, %rsi
callq 0x21a0
movq %r15, %rdi
callq 0x20b0
addq 0x40048(%rbx), %r12
shll $0x5, %r14d
addq 0x40060(%rbx), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x20d0
jmp 0x38c9
movq %r14, %rax
shrq $0x2a, %rax
movl %ebp, %r15d
movabsq $0x800400000, %r13      # imm = 0x800400000
jne 0x382a
movq %r14, %rax
notq %rax
testq %r13, %rax
jne 0x3865
movq %r14, %rax
shrq $0x18, %rax
andl $0x7ff, %eax            # imm = 0x7FF
addl 0x24(%rbx), %eax
movq 0x48(%rbx,%rax,8), %rdx
jmp 0x3837
leaq 0x1edc(%rip), %rax      # 0x56c3
leaq 0x1eda(%rip), %rsi      # 0x56c8
cmpb $0x0, 0x42(%rbx)
cmovneq %rax, %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x23cc
movl %ebp, %edi
shlq $0x5, %rdi
addq 0x40048(%rbx), %rdi
movq %r15, %rsi
callq 0x21a0
movq %r15, %rdi
callq 0x20b0
jmp 0x38c9
movabsq $0xffffff000000, %rdx   # imm = 0xFFFFFF000000
andq %r14, %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x32a6
movq %r15, %rdi
shlq $0x5, %rdi
addq 0x40048(%rbx), %rdi
movq %r12, %rsi
callq 0x21a0
movq %r12, %rdi
callq 0x20b0
movl %r14d, %eax
andl $0xbfffff, %eax         # imm = 0xBFFFFF
cmpl $0x8c0000, %eax         # imm = 0x8C0000
jne 0x3893
movq 0x40048(%rbx), %rax
shlq $0x5, %r15
movq (%rax,%r15), %rsi
leaq 0x1c55(%rip), %rdi      # 0x54df
xorl %eax, %eax
callq 0x2030
jmp 0x38c9
movl %r14d, %eax
andl $0xbc0000, %eax         # imm = 0xBC0000
cmpl $0x9c0000, %eax         # imm = 0x9C0000
jne 0x38d8
movq 0x40048(%rbx), %rax
shlq $0x5, %r15
movq (%rax,%r15), %rsi
andl $0x3ffff, %r14d         # imm = 0x3FFFF
leaq 0x1c2c(%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
addq $-0x400000, %r13        # imm = 0xFFC00000
cmpq %r13, %rax
jne 0x3958
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 0x3985
andl $0x7ff, %r13d           # imm = 0x7FF
movq 0x40048(%rbx), %rax
shll $0x5, %r13d
movq (%rax,%r13), %rdx
leaq 0x1bc4(%rip), %rsi      # 0x54f7
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x23cc
shlq $0x5, %r15
addq 0x40048(%rbx), %r15
movq %r15, %rdi
jmp 0x3720
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x39e6
movq (%r15), %rcx
leaq 0x1b99(%rip), %rdi      # 0x550d
movl %ebp, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2030
jmp 0x381d
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x39e6
shlq $0x5, %r15
movq 0x40048(%rbx), %rdi
addq %r15, %rdi
movq %r14, %rsi
callq 0x21a0
movq %r14, %rdi
callq 0x20b0
movq 0x40048(%rbx), %rax
movq (%rax,%r15), %rsi
andl $0x7ff, %r13d           # imm = 0x7FF
shll $0x5, %r13d
movq (%rax,%r13), %rdx
leaq 0x1b27(%rip), %rdi      # 0x54fd
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2030
jmp 0x38c9
nop