// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/dumpobj.c
// Function: got_rld
void got_rld(
    char *cp,
    int len)
{
    int             i;

    printf("RLD\n");

    for (i = 2; i < len;) {
        unsigned        addr;
        unsigned        word;
        unsigned        disp = cp[i + 1] & 0xff;
        char            name[8];
        char           *byte;

        addr = last_text_addr + disp - 4;

        byte = "";
        if (cp[i] & 0200)
            byte = " byte";

        switch (cp[i] & 0x7f) {
        case 01:
            printf("\tInternal%s %o=%o\n", byte, addr, WORD(cp + i + 2));
            i += 4;
            break;
        case 02:
            rad50name(cp + i + 2, name);
            printf("\tGlobal%s %o=%s\n", byte, addr, name);
            i += 6;
            break;
        case 03:
            printf("\tInternal displaced%s %o=%o\n", byte, addr, WORD(cp + i + 2));
            i += 4;
            badbin = 1;
            break;
        case 04:
            rad50name(cp + i + 2, name);
            printf("\tGlobal displaced%s %o=%s\n", byte, addr, name);
            i += 6;
            badbin = 1;
            break;
        case 05:
            rad50name(cp + i + 2, name);
            word = WORD(cp + i + 6);
            printf("\tGlobal plus offset%s %o=%s+%o\n", byte, addr, name, word);
            i += 8;
            badbin = 1;
            break;
        case 06:
            rad50name(cp + i + 2, name);
            word = WORD(cp + i + 6);
            printf("\tGlobal plus offset displaced%s %o=%s+%o\n", byte, addr, name, word);
            i += 8;
            badbin = 1;
            break;
        case 07:
            rad50name(cp + i + 2, name);
            word = WORD(cp + i + 6);
            printf("\tLocation counter definition %s+%o\n", name, word);
            i += 8;

            last_text_addr = word;
            break;
        case 010:
            word = WORD(cp + i + 2);
            printf("\tLocation counter modification %o\n", word);
            i += 4;

            last_text_addr = word;
            break;
        case 011:
            printf("\t.LIMIT %o\n", addr);
            i += 2;
            break;

        case 012:
            rad50name(cp + i + 2, name);
            printf("\tPSECT%s %o=%s\n", byte, addr, name);
            i += 6;
            badbin = 1;
            break;
        case 014:
            rad50name(cp + i + 2, name);

            printf("\tPSECT displaced%s %o=%s\n", byte, addr, name);
            i += 6;
            badbin = 1;
            break;
        case 015:
            rad50name(cp + i + 2, name);
            word = WORD(cp + i + 6);
            printf("\tPSECT plus offset%s %o=%s+%o\n", byte, addr, name, word);
            i += 8;
            badbin = 1;
            break;
        case 016:
            rad50name(cp + i + 2, name);
            word = WORD(cp + i + 6);
            printf("\tPSECT plus offset displaced%s %o=%s+%o\n", byte, addr, name, word);
            i += 8;
            badbin = 1;
            break;

        case 017:
            badbin = 1;
            printf("\tComplex%s %o=", byte, addr);
            i += 2; {
                char           *xp = cp + i;
                int             size;

                for (;;) {
                    size = 1;
                    switch (*xp) {
                    case 000:
                        fputs("nop ", stdout);
                        break;
                    case 001:
                        fputs("+ ", stdout);
                        break;
                    case 002:
                        fputs("- ", stdout);
                        break;
                    case 003:
                        fputs("* ", stdout);
                        break;
                    case 004:
                        fputs("/ ", stdout);
                        break;
                    case 005:
                        fputs("& ", stdout);
                        break;
                    case 006:
                        fputs("! ", stdout);
                        break;
                    case 010:
                        fputs("neg ", stdout);
                        break;
                    case 011:
                        fputs("^C ", stdout);
                        break;
                    case 012:
                        fputs("store ", stdout);
                        break;
                    case 013:
                        fputs("store{disp} ", stdout);
                        break;

                    case 016:
                        rad50name(xp + 1, name);
                        printf("%s ", name);
                        size = 5;
                        break;

                    case 017:
                        assert((xp[1] & 0377) < psectid);
                        printf("%s:%o ", psects[xp[1] & 0377], WORD(xp + 2));
                        size = 4;
                        break;

                    case 020:
                        printf("%o ", WORD(xp + 1));
                        size = 3;
                        break;
                    default:
                        printf("**UNKNOWN COMPLEX CODE** %o\n", *xp & 0377);
                        return;
                    }
                    i += size;
                    if (*xp == 012 || *xp == 013)
                        break;
                    xp += size;
                }
                fputc('\n', stdout);
                break;
            }

        default:
            printf("\t***Unknown RLD code %o\n", cp[i] & 0xff);
            return;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r13
leaq 0x18c8(%rip), %rdi      # 0x35d8
callq 0x1060
movl %ebx, 0x14(%rsp)
cmpl $0x3, %ebx
jl 0x2197
movl $0x2, %r12d
leaq 0x1335(%rip), %r14      # 0x3064
movq %r13, 0x8(%rsp)
movslq %r12d, %rbx
movzbl (%r13,%rbx), %esi
testb %sil, %sil
leaq 0x15e0(%rip), %rbp      # 0x3327
leaq 0x139c(%rip), %rax      # 0x30ea
cmovnsq %rax, %rbp
movl %esi, %eax
andl $0x7f, %eax
decl %eax
cmpl $0xe, %eax
ja 0x2189
movq %r13, %rdi
leaq (%rbx,%r13), %r15
movzbl 0x1(%r13,%rbx), %ecx
movl 0x3bfb(%rip), %edx      # 0x5970
leal (%rcx,%rdx), %r13d
addl $-0x4, %r13d
leaq 0x12a4(%rip), %rcx      # 0x3028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl 0x2(%r15), %ecx
movq %rdi, %rbx
leaq 0x1591(%rip), %rdi      # 0x332d
movq %rbp, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x10c0
addl $0x4, %r12d
jmp 0x2077
addq $0x2, %r15
movq %r15, %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1caa
leaq 0x166b(%rip), %rdi      # 0x3436
jmp 0x213a
movzwl 0x2(%r15), %ebp
movq %rdi, %r13
leaq 0x1618(%rip), %rdi      # 0x33f7
movl %ebp, %esi
xorl %eax, %eax
callq 0x10c0
addl $0x4, %r12d
jmp 0x20e8
leaq 0x2(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1caa
movzwl 0x6(%r15), %r8d
leaq 0x159d(%rip), %rdi      # 0x33a9
jmp 0x210b
movzwl 0x2(%r15), %ecx
movq %rdi, %rbx
leaq 0x1531(%rip), %rdi      # 0x3351
movq %rbp, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x10c0
addl $0x4, %r12d
movl $0x1, 0x3315(%rip)      # 0x5150
jmp 0x2077
addq $0x2, %r15
movq %r15, %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1caa
leaq 0x14e7(%rip), %rdi      # 0x3340
movq %rbp, %rsi
movl %r13d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10c0
addl $0x6, %r12d
jmp 0x2158
leaq 0x2(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1caa
movzwl 0x6(%r15), %r8d
leaq 0x15c3(%rip), %rdi      # 0x3450
jmp 0x210b
movl $0x1, 0x32b4(%rip)      # 0x5150
movq %rdi, %r15
leaq 0x15f2(%rip), %rdi      # 0x3498
movq %rbp, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x10c0
leal 0x2(%rbx), %r12d
movq %r15, %r13
addq %rbx, %r15
addq $0x2, %r15
movzbl (%r15), %esi
cmpq $0x10, %rsi
ja 0x2180
movslq (%r14,%rsi,4), %rax
addq %r14, %rax
jmpq *%rax
movq 0x30f9(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x15be(%rip), %rdi      # 0x34a7
jmp 0x2039
movq 0x30e3(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x15cf(%rip), %rdi      # 0x34ce
jmp 0x2039
movq 0x30cd(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x15a9(%rip), %rdi      # 0x34be
jmp 0x2039
movq 0x30b7(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x158d(%rip), %rdi      # 0x34b8
jmp 0x2039
movq 0x30a1(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x156e(%rip), %rdi      # 0x34af
jmp 0x2039
movq 0x308b(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x1555(%rip), %rdi      # 0x34ac
jmp 0x2039
leaq 0x1(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1caa
leaq 0x1569(%rip), %rdi      # 0x34db
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
movl $0x5, %eax
jmp 0x2043
movzwl 0x1(%r15), %esi
leaq 0x158d(%rip), %rdi      # 0x351f
xorl %eax, %eax
callq 0x10c0
movl $0x3, %eax
jmp 0x2043
movq 0x302e(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x150f(%rip), %rdi      # 0x34c3
jmp 0x2039
movq 0x3018(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x14e8(%rip), %rdi      # 0x34b2
jmp 0x2039
movzbl 0x1(%r15), %eax
cmpl %eax, 0x3169(%rip)      # 0x5140
jle 0x21a6
leaq 0x318c(%rip), %rcx      # 0x5170
movq (%rcx,%rax,8), %rsi
movzwl 0x2(%r15), %edx
leaq 0x1528(%rip), %rdi      # 0x351c
xorl %eax, %eax
callq 0x10c0
movl $0x4, %eax
jmp 0x2043
movq 0x2fcf(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x14a8(%rip), %rdi      # 0x34bb
jmp 0x2039
movq 0x2fbc(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x148f(%rip), %rdi      # 0x34b5
jmp 0x2039
movq 0x2fa9(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x148e(%rip), %rdi      # 0x34c7
callq 0x10e0
movl $0x1, %eax
addl %eax, %r12d
movb (%r15), %cl
andb $-0x2, %cl
cmpb $0xa, %cl
je 0x216a
movl %eax, %eax
addq %rax, %r15
jmp 0x1ec1
movq %rdi, %rbx
leaq 0x13b1(%rip), %rdi      # 0x341a
movl %r13d, %esi
xorl %eax, %eax
callq 0x10c0
addl $0x2, %r12d
movq %rbx, %r13
jmp 0x215d
addq $0x2, %r15
movq %r15, %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1caa
leaq 0x12d6(%rip), %rdi      # 0x336e
jmp 0x213a
leaq 0x2(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1caa
movzwl 0x6(%r15), %r8d
leaq 0x13b7(%rip), %rdi      # 0x346f
jmp 0x210b
movq %rdi, %r13
leaq 0x2(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1caa
movzwl 0x6(%r15), %ebp
leaq 0x12fb(%rip), %rdi      # 0x33d3
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x10c0
addl $0x8, %r12d
movl %ebp, 0x3882(%rip)      # 0x5970
jmp 0x215d
leaq 0x2(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1caa
movzwl 0x6(%r15), %r8d
leaq 0x127e(%rip), %rdi      # 0x3389
movq %rbp, %rsi
movl %r13d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10c0
addl $0x8, %r12d
jmp 0x214e
addq $0x2, %r15
movq %r15, %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1caa
leaq 0x12ec(%rip), %rdi      # 0x3426
movq %rbp, %rsi
movl %r13d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10c0
addl $0x6, %r12d
movl $0x1, 0x2ff8(%rip)      # 0x5150
movq 0x8(%rsp), %r13
cmpl 0x14(%rsp), %r12d
jl 0x1d34
jmp 0x2197
movq 0x2e67(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
movl $0xa, %edi
callq 0x1100
jmp 0x215d
leaq 0x139c(%rip), %rdi      # 0x3523
jmp 0x2190
leaq 0x13b0(%rip), %rdi      # 0x3540
xorl %eax, %eax
callq 0x10c0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1332(%rip), %rdi      # 0x34df
leaq 0x1344(%rip), %rsi      # 0x34f8
leaq 0x1347(%rip), %rcx      # 0x3502
movl $0x268, %edx            # imm = 0x268
callq 0x10d0