// File: /workspace/github_c_makefile_star2_O2/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, %r13
leaq 0x19e5(%rip), %rdi      # 0x35d8
callq 0x1060
pushq $0x2
popq %r12
leaq 0x1461(%rip), %r14      # 0x3064
movq %r13, 0x8(%rsp)
cmpl 0x14(%rsp), %r12d
jge 0x2075
movslq %r12d, %rbx
movzbl (%r13,%rbx), %esi
testb %sil, %sil
leaq 0x1701(%rip), %rbp      # 0x3327
leaq 0x14bd(%rip), %rax      # 0x30ea
cmovnsq %rax, %rbp
movl %esi, %eax
andl $0x7f, %eax
decl %eax
cmpl $0xe, %eax
ja 0x2067
movq %r13, %rdi
leaq (%rbx,%r13), %r15
movzbl 0x1(%r13,%rbx), %ecx
movl 0x3d1c(%rip), %edx      # 0x5970
leal (%rcx,%rdx), %r13d
addl $-0x4, %r13d
leaq 0x13c5(%rip), %rcx      # 0x3028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl 0x2(%r15), %ecx
movq %rdi, %rbx
leaq 0x16b2(%rip), %rdi      # 0x332d
movq %rbp, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x10c0
addl $0x4, %r12d
movq %rbx, %r13
jmp 0x1c08
addq $0x2, %r15
movq %r15, %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1ba4
leaq 0x1789(%rip), %rdi      # 0x3436
jmp 0x201f
movzwl 0x2(%r15), %ebp
movq %rdi, %r13
leaq 0x1736(%rip), %rdi      # 0x33f7
movl %ebp, %esi
xorl %eax, %eax
callq 0x10c0
addl $0x4, %r12d
movl %ebp, 0x3c9c(%rip)      # 0x5970
jmp 0x1c08
leaq 0x2(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1ba4
movzwl 0x6(%r15), %r8d
leaq 0x16b5(%rip), %rdi      # 0x33a9
jmp 0x1ff0
movzwl 0x2(%r15), %ecx
movq %rdi, %rbx
leaq 0x1649(%rip), %rdi      # 0x3351
movq %rbp, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x10c0
addl $0x4, %r12d
movl $0x1, 0x342d(%rip)      # 0x5150
movq %rbx, %r13
jmp 0x1c08
addq $0x2, %r15
movq %r15, %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1ba4
leaq 0x15fc(%rip), %rdi      # 0x3340
movq %rbp, %rsi
movl %r13d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10c0
addl $0x6, %r12d
movq 0x8(%rsp), %r13
jmp 0x1c08
leaq 0x2(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1ba4
movzwl 0x6(%r15), %r8d
leaq 0x16d3(%rip), %rdi      # 0x3450
jmp 0x1ff0
movl $0x1, 0x33c4(%rip)      # 0x5150
movq %rdi, %r15
leaq 0x1702(%rip), %rdi      # 0x3498
movq %rbp, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x10c0
addl $0x2, %r12d
movq %r15, %r13
addq %rbx, %r15
addq $0x2, %r15
movzbl (%r15), %esi
cmpq $0x10, %rsi
ja 0x205e
movslq (%r14,%rsi,4), %rax
addq %r14, %rax
jmpq *%rax
movq 0x3209(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x16ce(%rip), %rdi      # 0x34a7
jmp 0x1f1d
movq 0x31f3(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x16df(%rip), %rdi      # 0x34ce
jmp 0x1f1d
movq 0x31dd(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x16b9(%rip), %rdi      # 0x34be
jmp 0x1f1d
movq 0x31c7(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x169d(%rip), %rdi      # 0x34b8
jmp 0x1f1d
movq 0x31b1(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x167e(%rip), %rdi      # 0x34af
jmp 0x1f1d
movq 0x319b(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x1665(%rip), %rdi      # 0x34ac
jmp 0x1f1d
leaq 0x1(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1ba4
leaq 0x1679(%rip), %rdi      # 0x34db
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
pushq $0x5
jmp 0x1f24
movzwl 0x1(%r15), %esi
leaq 0x16a0(%rip), %rdi      # 0x351f
xorl %eax, %eax
callq 0x10c0
pushq $0x3
jmp 0x1f24
movq 0x3144(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x1625(%rip), %rdi      # 0x34c3
jmp 0x1f1d
movq 0x3131(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x1601(%rip), %rdi      # 0x34b2
jmp 0x1f1d
movzbl 0x1(%r15), %eax
cmpl %eax, 0x3282(%rip)      # 0x5140
jle 0x2084
leaq 0x32a5(%rip), %rcx      # 0x5170
movq (%rcx,%rax,8), %rsi
movzwl 0x2(%r15), %edx
leaq 0x1641(%rip), %rdi      # 0x351c
xorl %eax, %eax
callq 0x10c0
pushq $0x4
jmp 0x1f24
movq 0x30eb(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x15c4(%rip), %rdi      # 0x34bb
jmp 0x1f1d
movq 0x30d8(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x15ab(%rip), %rdi      # 0x34b5
jmp 0x1f1d
movq 0x30c5(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x15aa(%rip), %rdi      # 0x34c7
callq 0x10e0
pushq $0x1
popq %rax
addl %eax, %r12d
movb (%r15), %cl
andb $-0x2, %cl
cmpb $0xa, %cl
je 0x2047
movl %eax, %eax
addq %rax, %r15
jmp 0x1db1
movq %rdi, %rbx
leaq 0x14cf(%rip), %rdi      # 0x341a
movl %r13d, %esi
xorl %eax, %eax
callq 0x10c0
addl $0x2, %r12d
movq %rbx, %r13
jmp 0x1c08
addq $0x2, %r15
movq %r15, %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1ba4
leaq 0x13f4(%rip), %rdi      # 0x336e
jmp 0x201f
leaq 0x2(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1ba4
movzwl 0x6(%r15), %r8d
leaq 0x14d5(%rip), %rdi      # 0x346f
jmp 0x1ff0
movq %rdi, %r13
leaq 0x2(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1ba4
movzwl 0x6(%r15), %ebp
leaq 0x1419(%rip), %rdi      # 0x33d3
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x10c0
addl $0x8, %r12d
movl %ebp, 0x39a0(%rip)      # 0x5970
jmp 0x1c08
leaq 0x2(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1ba4
movzwl 0x6(%r15), %r8d
leaq 0x1399(%rip), %rdi      # 0x3389
movq %rbp, %rsi
movl %r13d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10c0
addl $0x8, %r12d
jmp 0x2033
addq $0x2, %r15
movq %r15, %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1ba4
leaq 0x1407(%rip), %rdi      # 0x3426
movq %rbp, %rsi
movl %r13d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10c0
addl $0x6, %r12d
movl $0x1, 0x3113(%rip)      # 0x5150
movq 0x8(%rsp), %r13
jmp 0x1c08
movq 0x2f8a(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
pushq $0xa
popq %rdi
callq 0x1100
jmp 0x1c08
leaq 0x14be(%rip), %rdi      # 0x3523
jmp 0x206e
leaq 0x14d2(%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 0x1454(%rip), %rdi      # 0x34df
leaq 0x1466(%rip), %rsi      # 0x34f8
leaq 0x1469(%rip), %rcx      # 0x3502
movl $0x268, %edx            # imm = 0x268
callq 0x10d0