// File: /workspace/github_c_makefile_star2_O1/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, 0x14(%rsp)
movq %rdi, %r14
leaq 0x18bb(%rip), %rdi      # 0x35d8
callq 0x1060
movl $0x2, %r13d
cmpl 0x14(%rsp), %r13d
jge 0x2142
movslq %r13d, %rbx
movzbl (%r14,%rbx), %esi
testb %sil, %sil
leaq 0x15e2(%rip), %r15      # 0x3327
leaq 0x139e(%rip), %rax      # 0x30ea
cmovnsq %rax, %r15
movl %esi, %eax
andl $0x7f, %eax
decl %eax
cmpl $0xe, %eax
ja 0x2115
leaq (%r14,%rbx), %r12
movzbl 0x1(%r14,%rbx), %ecx
movl 0x3c00(%rip), %edx      # 0x5970
leal (%rcx,%rdx), %ebp
addl $-0x4, %ebp
leaq 0x12ab(%rip), %rcx      # 0x3028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl 0x2(%r12), %ecx
leaq 0x159a(%rip), %rdi      # 0x332d
movq %r15, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x10c0
addl $0x4, %r13d
jmp 0x20f1
movl $0x1, 0x339e(%rip)      # 0x5150
leaq 0x16df(%rip), %rdi      # 0x3498
movq %r15, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x10c0
addl $0x2, %r13d
leaq (%rbx,%r14), %r15
addq $0x2, %r15
leaq 0x128c(%rip), %r12      # 0x3064
movq 0x31f9(%rip), %rbp      # 0x4fd8
movzbl (%r15), %esi
cmpq $0x10, %rsi
ja 0x2137
movslq (%r12,%rsi,4), %rax
addq %r12, %rax
jmpq *%rax
movq (%rbp), %rsi
leaq 0x16a6(%rip), %rdi      # 0x34a7
jmp 0x1f11
movq (%rbp), %rsi
leaq 0x16bd(%rip), %rdi      # 0x34ce
jmp 0x1f11
movq (%rbp), %rsi
leaq 0x169d(%rip), %rdi      # 0x34be
jmp 0x1f11
movq (%rbp), %rsi
leaq 0x1687(%rip), %rdi      # 0x34b8
jmp 0x1f11
movq (%rbp), %rsi
leaq 0x166e(%rip), %rdi      # 0x34af
jmp 0x1f11
movq (%rbp), %rsi
leaq 0x165b(%rip), %rdi      # 0x34ac
jmp 0x1f11
leaq 0x1(%r15), %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x1cb5
leaq 0x166d(%rip), %rdi      # 0x34db
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
movl $0x5, %eax
jmp 0x1f1b
movzwl 0x1(%r15), %esi
leaq 0x1691(%rip), %rdi      # 0x351f
xorl %eax, %eax
callq 0x10c0
movl $0x3, %eax
jmp 0x1f1b
movq (%rbp), %rsi
leaq 0x161c(%rip), %rdi      # 0x34c3
jmp 0x1f11
movq (%rbp), %rsi
leaq 0x15fe(%rip), %rdi      # 0x34b2
jmp 0x1f11
movzbl 0x1(%r15), %eax
cmpl %eax, 0x327f(%rip)      # 0x5140
jle 0x2151
leaq 0x32a2(%rip), %rcx      # 0x5170
movq (%rcx,%rax,8), %rsi
movzwl 0x2(%r15), %edx
leaq 0x163e(%rip), %rdi      # 0x351c
xorl %eax, %eax
callq 0x10c0
movl $0x4, %eax
jmp 0x1f1b
movq (%rbp), %rsi
leaq 0x15c4(%rip), %rdi      # 0x34bb
jmp 0x1f11
movq (%rbp), %rsi
leaq 0x15b1(%rip), %rdi      # 0x34b5
jmp 0x1f11
movq (%rbp), %rsi
leaq 0x15b6(%rip), %rdi      # 0x34c7
callq 0x10e0
movl $0x1, %eax
addl %eax, %r13d
movb (%r15), %cl
andb $-0x2, %cl
cmpb $0xa, %cl
je 0x2127
movl %eax, %eax
addq %rax, %r15
jmp 0x1ddf
addq $0x2, %r12
movq %r12, %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x1cb5
leaq 0x14e4(%rip), %rdi      # 0x3436
jmp 0x20d4
leaq 0x2(%r12), %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x1cb5
movzwl 0x6(%r12), %r8d
leaq 0x1413(%rip), %rdi      # 0x3389
jmp 0x1fd9
leaq 0x2(%r12), %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x1cb5
movzwl 0x6(%r12), %r8d
leaq 0x14d8(%rip), %rdi      # 0x346f
jmp 0x1fd9
leaq 0x2(%r12), %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x1cb5
movzwl 0x6(%r12), %r8d
leaq 0x13f1(%rip), %rdi      # 0x33a9
jmp 0x1fd9
leaq 0x2(%r12), %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x1cb5
movzwl 0x6(%r12), %r8d
leaq 0x1477(%rip), %rdi      # 0x3450
movq %r15, %rsi
movl %ebp, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10c0
addl $0x8, %r13d
jmp 0x20e7
addq $0x2, %r12
movq %r12, %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x1cb5
leaq 0x1362(%rip), %rdi      # 0x336e
jmp 0x20d4
movzwl 0x2(%r12), %ecx
leaq 0x1333(%rip), %rdi      # 0x3351
movq %r15, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x10c0
addl $0x4, %r13d
jmp 0x20e7
addq $0x2, %r12
movq %r12, %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x1cb5
leaq 0x12f2(%rip), %rdi      # 0x3340
movq %r15, %rsi
movl %ebp, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10c0
addl $0x6, %r13d
jmp 0x20f1
leaq 0x2(%r12), %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x1cb5
movzwl 0x6(%r12), %ebp
leaq 0x134e(%rip), %rdi      # 0x33d3
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x10c0
addl $0x8, %r13d
jmp 0x20b1
movzwl 0x2(%r12), %ebp
leaq 0x1353(%rip), %rdi      # 0x33f7
movl %ebp, %esi
xorl %eax, %eax
callq 0x10c0
addl $0x4, %r13d
movl %ebp, 0x38b9(%rip)      # 0x5970
jmp 0x20f1
addq $0x2, %r12
movq %r12, %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x1cb5
leaq 0x1352(%rip), %rdi      # 0x3426
movq %r15, %rsi
movl %ebp, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10c0
addl $0x6, %r13d
movl $0x1, 0x305f(%rip)      # 0x5150
movb $0x1, %bpl
testb %bpl, %bpl
jne 0x1d28
jmp 0x2142
leaq 0x1314(%rip), %rdi      # 0x341a
movl %ebp, %esi
xorl %eax, %eax
callq 0x10c0
addl $0x2, %r13d
jmp 0x20f1
xorl %ebp, %ebp
leaq 0x1422(%rip), %rdi      # 0x3540
xorl %eax, %eax
callq 0x10c0
jmp 0x20f4
movq (%rbp), %rsi
movl $0xa, %edi
callq 0x1100
jmp 0x20f1
xorl %ebp, %ebp
leaq 0x13e3(%rip), %rdi      # 0x3523
jmp 0x211e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1387(%rip), %rdi      # 0x34df
leaq 0x1399(%rip), %rsi      # 0x34f8
leaq 0x139c(%rip), %rcx      # 0x3502
movl $0x268, %edx            # imm = 0x268
callq 0x10d0