LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/macros.c
// Function: dumpmacro
void dumpmacro(
    MACRO *mac,
    FILE *fp)
{
    ARG            *arg;

    fprintf(fp, ".MACRO %s ", mac->sym.label);

    for (arg = mac->args; arg != NULL; arg = arg->next) {
        fputs(arg->label, fp);
        if (arg->value) {
            fputc('=', fp);
            fputs(arg->value, fp);
        }
        fputc(' ', fp);
    }
    fputc('\n', fp);

    fputs(mac->text->buffer, fp);

    fputs(".ENDM\n", fp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdx
leaq 0x874d(%rip), %rsi      # 0x10510
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21e0
movq 0x28(%r14), %r15
testq %r15, %r15
je 0x7e14
movq 0x10(%r15), %rdi
movq %rbx, %rsi
callq 0x2130
cmpq $0x0, 0x18(%r15)
je 0x7e02
movl $0x3d, %edi
movq %rbx, %rsi
callq 0x2170
movq 0x18(%r15), %rdi
movq %rbx, %rsi
callq 0x2130
movl $0x20, %edi
movq %rbx, %rsi
callq 0x2170
movq (%r15), %r15
jmp 0x7dd1
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2170
movq 0x30(%r14), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x2130
leaq 0x86e4(%rip), %rdi      # 0x1051b
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2130
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/macros.c
// Function: free_macro
void free_macro(
    MACRO *mac)
{
    if (mac->text) {
        free(mac->text);
    }
    free_args(mac->args);
    free_sym(&mac->sym);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x8057
callq 0x2050
movq 0x28(%rbx), %rdi
callq 0x8680
movq %rbx, %rdi
popq %rbx
jmp 0x9daf
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/macros.c
// Function: new_macro
MACRO          *new_macro(
    char *label)
{
    MACRO          *mac = memcheck(malloc(sizeof(MACRO)));

    mac->sym.flags = 0;
    mac->sym.label = label;
    mac->sym.stmtno = stmtno;
    mac->sym.next = NULL;
    mac->sym.section = &macro_section;
    mac->sym.value = 0;
    mac->args = NULL;
    mac->text = NULL;

    return mac;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x38, %edi
callq 0x2230
movq %rax, %rdi
callq 0xe094
xorl %ecx, %ecx
movl %ecx, 0x10(%rax)
movq %rbx, (%rax)
leaq 0xdad6(%rip), %rdx      # 0x15b64
movl (%rdx), %edx
movl %edx, 0xc(%rax)
movq $0x0, 0x20(%rax)
leaq 0xd16e(%rip), %rdx      # 0x15210
movq %rdx, 0x18(%rax)
movl %ecx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/macros.c
// Function: new_arg
ARG            *new_arg(
    void)
{
    ARG            *arg = memcheck(malloc(sizeof(ARG)));

    arg->locsym = 0;
    arg->value = NULL;
    arg->next = NULL;
    arg->label = NULL;
    return arg;
}

// Assembly:
pushq %rax
movl $0x20, %edi
callq 0x2230
movq %rax, %rdi
callq 0xe094
movl $0x0, 0x8(%rax)
movq $0x0, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/macros.c
// Function: eval_str
char *eval_str(
    STREAM *refstr,
    char *arg)
{
    EX_TREE        *value = parse_expr(arg, 0);
    unsigned        word = 0;
    char            temp[10];

    if (value->type != EX_LIT) {
        report(refstr, "Constant value required\n");
    } else
        word = value->data.lit;

    free_tree(value);

    /* printf can't do base 2. */
    my_ultoa(word & 0177777, temp, radix);
    free(arg);
    arg = memcheck(strdup(temp));
    return arg;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r12
movq %rsi, %rdi
xorl %esi, %esi
callq 0x8fc7
movq %rax, %r14
cmpl $0x1, (%rax)
jne 0x826b
movzwl 0x10(%r14), %r15d
jmp 0x827f
leaq 0x82e2(%rip), %rsi      # 0x10554
xorl %r15d, %r15d
movq %r12, %rdi
xorl %eax, %eax
callq 0x7a34
movq %r14, %rdi
callq 0x6d77
leaq 0xcf12(%rip), %rax      # 0x151a0
movl (%rax), %edx
leaq 0xe(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0xded0
movq %rbx, %rdi
callq 0x2050
movq %r14, %rdi
callq 0x22e0
movq %rax, %rdi
callq 0xe094
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/macros.c
// Function: getstring_macarg
char           *getstring_macarg(
    STREAM *refstr,
    char *cp,
    char **endp)
{
    if (cp[0] == '\\') {
        char *str = getstring(cp + 1, endp);
        return eval_str(refstr, str);         /* Perform expression evaluation */
    } else {
        return getstring(cp, endp);
    }
}

// Assembly:
cmpb $0x5c, (%rsi)
jne 0x82e7
pushq %rbx
movq %rdi, %rbx
incq %rsi
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x87b7
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x8241
movq %rsi, %rdi
movq %rdx, %rsi
jmp 0x87b7
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/macros.c
// Function: free_args
static void free_args(
    ARG *arg)
{
    ARG            *next;

    while (arg) {
        next = arg->next;
        if (arg->label) {
            free(arg->label);
            arg->label = NULL;
        }
        if (arg->value) {
            free(arg->value);
            arg->value = NULL;
        }
        free(arg);
        arg = next;
    }
}

// Assembly:
testq %rdi, %rdi
je 0x86ca
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rbx), %r14
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x86a5
callq 0x2050
movq $0x0, 0x10(%rbx)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x86b3
callq 0x2050
movq %rbx, %rdi
callq 0x2050
movq %r14, %rbx
testq %r14, %r14
jne 0x868c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/macros.c
// Function: dump_all_macros
void dump_all_macros(
    void)
{
    MACRO          *mac;
    SYMBOL_ITER     iter;

    for (mac = (MACRO *) first_sym(&macro_st, &iter); mac != NULL; mac = (MACRO *) next_sym(&macro_st, &iter)) {
        dumpmacro(mac, lstfile);

        fprintf(lstfile, "\n\n");
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x14fdb(%rip), %rdi     # 0x1d6b8
leaq 0x8(%rsp), %rsi
callq 0x9ef7
testq %rax, %rax
je 0x8738
leaq 0xef6d(%rip), %r12      # 0x17660
leaq 0x8431(%rip), %rbx      # 0x10b2b
leaq 0x14fb7(%rip), %r14     # 0x1d6b8
leaq 0x8(%rsp), %r15
movq (%r12), %rsi
movq %rax, %rdi
callq 0x7dae
movq (%r12), %rcx
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x22d0
movq %r14, %rdi
movq %r15, %rsi
callq 0x9ea4
testq %rax, %rax
jne 0x8706
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/parse.c
// Function: skipdelim
char           *skipdelim(
    char *cp)
{
    cp = skipwhite(cp);
    if (*cp == ',')
        cp = skipwhite(cp + 1);
    return cp;
}

// Assembly:
movq %rdi, %rax
movzbl (%rax), %ecx
cmpl $0x9, %ecx
je 0x876a
cmpl $0x20, %ecx
jne 0x876f
incq %rax
jmp 0x875d
cmpl $0x2c, %ecx
jne 0x8784
incq %rax
movzbl (%rax), %ecx
cmpl $0x20, %ecx
je 0x8774
cmpl $0x9, %ecx
je 0x8774
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/parse.c
// Function: skipdelim_comma
char           *skipdelim_comma(
    char *cp,
    int  *comma)
{
    cp = skipwhite(cp);
    if ((*comma = (*cp == ','))) {
        cp = skipwhite(cp + 1);
    }
    return cp;
}

// Assembly:
movq %rdi, %rax
movzbl (%rax), %ecx
cmpl $0x20, %ecx
je 0x8795
cmpl $0x9, %ecx
jne 0x879a
incq %rax
jmp 0x8788
xorl %edx, %edx
cmpb $0x2c, %cl
sete %dl
movl %edx, (%rsi)
jne 0x87b6
incq %rax
movzbl (%rax), %ecx
cmpl $0x20, %ecx
je 0x87a6
cmpl $0x9, %ecx
je 0x87a6
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/parse.c
// Function: getstring
char           *getstring(
    char *cp,
    char **endp)
{
    int             len;
    int             start;
    char           *str;

    if (!brackrange(cp, &start, &len, endp)) {
        start = 0;
        len = strcspn(cp, " \t\n,;");
        if (endp)
            *endp = cp + len;
    }

    str = memcheck(malloc(len + 1));
    memcpy(str, cp + start, len);
    str[len] = 0;

    return str;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %rsi
leaq 0x4(%rsp), %rdx
movq %r15, %rcx
callq 0x8846
testl %eax, %eax
je 0x87e4
movl 0x4(%rsp), %r14d
movslq (%rsp), %r12
jmp 0x8807
leaq 0x7e25(%rip), %rsi      # 0x10610
movq %rbx, %rdi
callq 0x2180
movq %rax, %r14
testq %r15, %r15
je 0x8804
movslq %r14d, %rax
addq %rbx, %rax
movq %rax, (%r15)
xorl %r12d, %r12d
leal 0x1(%r14), %eax
movslq %eax, %rdi
callq 0x2230
movq %rax, %rdi
callq 0xe094
movq %rax, %r15
addq %r12, %rbx
movslq %r14d, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2220
movb $0x0, (%r15,%r14)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/parse.c
// Function: brackrange
int brackrange(
    char *cp,
    int *start,
    int *length,
    char **endp)
{
    char            endstr[6];
    int             endlen;
    int             nest;
    int             len;

    switch (*cp) {
    case '^':
        endstr[0] = cp[1];
        strcpy(endstr + 1, "\n");
        *start = 2;
        endlen = 1;
        break;
    case '<':
        strcpy(endstr, "<>\n");
        endlen = 1;
        *start = 1;
        break;
    default:
        return FALSE;
    }

    cp += *start;

    len = 0;
    if (endstr[1] == '>') { /* <>\n */
        nest = 1;
        while (nest) {
            int             sublen;

            sublen = strcspn(cp + len, endstr);
            if (cp[len + sublen] == '<') {
                nest++;
                sublen++;  /* avoid infinite loop when sublen == 0 */
            } else {
                nest--;
                if (nest > 0 && cp[len + sublen] == '>')
                    sublen++;  /* avoid infinite loop when sublen == 0 */
            }
            len += sublen;
            if (sublen == 0)
                break;
        }
    } else {
        int             sublen;

        sublen = strcspn(cp + len, endstr);
        len += sublen;
    }

    *length = len;
    if (endp)
        *endp = cp + len + endlen;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movzbl (%rdi), %r8d
cmpl $0x5e, %r8d
je 0x88f2
xorl %eax, %eax
cmpl $0x3c, %r8d
jne 0x8956
movq %rdx, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
leaq 0x20(%rsp), %r13
movl $0xa3e3c, (%r13)        # imm = 0xA3E3C
movl $0x1, (%rsi)
movq %rdi, 0x8(%rsp)
leaq 0x1(%rdi), %r15
xorl %r12d, %r12d
movl $0x1, %ebx
movl $0x1, %ebp
testl %ebx, %ebx
je 0x892b
movslq %r12d, %r14
leaq (%r15,%r14), %rdi
movq %r13, %rsi
callq 0x2180
addl %eax, %r14d
movslq %r14d, %rcx
movb (%r15,%rcx), %cl
cmpb $0x3c, %cl
jne 0x88cd
incl %ebx
incl %eax
jmp 0x88e9
cmpl $0x2, %ebx
leal -0x1(%rbx), %edx
setge %sil
cmpb $0x3e, %cl
sete %cl
andb %sil, %cl
movzbl %cl, %ecx
addl %eax, %ecx
movl %edx, %ebx
movl %ecx, %eax
addl %eax, %r12d
testl %eax, %eax
jne 0x88a1
jmp 0x892b
movq %rdx, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
movb 0x1(%rdi), %cl
leaq 0x20(%rsp), %rax
movb %cl, (%rax)
movw $0xa, 0x1(%rax)
movl $0x2, (%rsi)
movq %rdi, 0x8(%rsp)
addq $0x2, %rdi
movq %rax, %rsi
callq 0x2180
movq %rax, %r12
movl $0x2, %ebp
movq 0x10(%rsp), %rax
movl %r12d, (%rax)
movl $0x1, %eax
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
je 0x8956
movq 0x8(%rsp), %rsi
addq %rbp, %rsi
movslq %r12d, %rcx
addq %rsi, %rcx
incq %rcx
movq %rcx, (%rdx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/parse.c
// Function: getstring_fn
char           *getstring_fn(
    char *cp,
    char **endp)
{
    char            endstr[4];
    int             len;
    char           *str;

    switch (*cp) {
    case '<':
    case ':':
        return NULL;
    }

    if (!ispunct((unsigned char)*cp)) {
        return NULL;
    }

    endstr[0] = *cp;
    endstr[1] = '\n';
    endstr[2] = '\0';
    cp++;

    len = strcspn(cp, endstr);

    if (endp)
        *endp = cp + len + 1;

    str = memcheck(malloc(len + 1));
    memcpy(str, cp, len);
    str[len] = 0;

    return str;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movzbl (%rdi), %r15d
xorl %r12d, %r12d
cmpl $0x3a, %r15d
je 0x8a08
cmpl $0x3c, %r15d
je 0x8a08
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2300
movq (%rax), %rax
testb $0x4, (%rax,%r15,2)
jne 0x89a2
xorl %r12d, %r12d
jmp 0x8a08
leaq 0x4(%rsp), %rsi
movb %r15b, (%rsi)
movw $0xa, 0x1(%rsi)
incq %rbx
movq %rbx, %rdi
callq 0x2180
movslq %eax, %r15
movq %rax, %rdi
shlq $0x20, %rdi
testq %r14, %r14
je 0x89d4
leaq (%rbx,%r15), %rax
incq %rax
movq %rax, (%r14)
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rdi
sarq $0x20, %rdi
callq 0x2230
movq %rax, %rdi
callq 0xe094
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2220
movb $0x0, (%r12,%r15)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/parse.c
// Function: get_op
SYMBOL         *get_op(
    char *cp,
    char **endp)
{
    int             local;
    char           *label;
    SYMBOL         *op;

    cp = skipwhite(cp);
    if (EOL(*cp))
        return NULL;

    label = get_symbol(cp, &cp, &local);
    if (label == NULL)
        return NULL;                   /* No operation code. */

    cp = skipwhite(cp);
    if (*cp == ':') {                  /* A label definition? */
        cp++;
        if (*cp == ':')
            cp++;                      /* Skip it */
        free(label);
        label = get_symbol(cp, &cp, NULL);
        if (label == NULL)
            return NULL;
    }

    op = lookup_sym(label, &system_st);
    free(label);

    if (endp)
        *endp = cp;

    return op;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movzbl (%rdi), %eax
cmpl $0x20, %eax
je 0x8a30
cmpl $0x9, %eax
jne 0x8a35
incq %rdi
jmp 0x8a23
movq %rdi, (%rsp)
cmpl $0x3b, %eax
ja 0x8a60
movl %eax, %eax
movabsq $0x800000000000401, %rcx # imm = 0x800000000000401
btq %rax, %rcx
jae 0x8a60
xorl %r15d, %r15d
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rsp, %rsi
leaq 0xc(%rsp), %rdx
callq 0x8af9
testq %rax, %rax
je 0x8a50
movq %rax, %r14
movq (%rsp), %rax
movzbl (%rax), %ecx
cmpl $0x20, %ecx
je 0x8a86
cmpl $0x9, %ecx
jne 0x8a8b
incq %rax
jmp 0x8a79
movq %rax, (%rsp)
cmpb $0x3a, (%rax)
jne 0x8aca
leaq 0x1(%rax), %rcx
movq %rcx, (%rsp)
cmpb $0x3a, 0x1(%rax)
jne 0x8aaa
addq $0x2, %rax
movq %rax, (%rsp)
movq %r14, %rdi
callq 0x2050
movq %rsp, %rsi
movq (%rsi), %rdi
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x8af9
movq %rax, %r14
testq %rax, %rax
je 0x8a53
leaq 0x10bb7(%rip), %rsi     # 0x19688
movq %r14, %rdi
callq 0x9e32
movq %rax, %r15
movq %r14, %rdi
callq 0x2050
testq %rbx, %rbx
je 0x8a53
movq (%rsp), %rax
movq %rax, (%rbx)
jmp 0x8a53
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/parse.c
// Function: parse_expr
EX_TREE        *parse_expr(
    char *cp,
    int undef)
{
    EX_TREE        *expr;
    EX_TREE        *value;

    expr = parse_binary(cp, 0, 0);     /* Parse into a tree */
    value = evaluate(expr, undef);     /* Perform the arithmetic */
    value->cp = expr->cp;              /* Pointer to end of text is part of
                                          the rootmost node  */
    free_tree(expr);                   /* Discard parse in favor of
                                          evaluation */

    return value;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
xorl %esi, %esi
xorl %edx, %edx
callq 0x9144
movq %rax, %r14
movq %rax, %rdi
movl %ebx, %esi
callq 0x6ee6
movq %rax, %rbx
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
movq %r14, %rdi
callq 0x6d77
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/parse.c
// Function: parse_unary_expr
EX_TREE        *parse_unary_expr(
    char *cp,
    int undef)
{
    EX_TREE        *expr;
    EX_TREE        *value;

    expr = parse_unary(cp);            /* Parse into a tree */
    value = evaluate(expr, undef);     /* Perform the arithmetic */
    value->cp = expr->cp;              /* Pointer to end of text is part of
                                          the rootmost node  */
    free_tree(expr);                   /* Discard parse in favor of
                                          evaluation */

    return value;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
callq 0x9211
movq %rax, %r14
movq %rax, %rdi
movl %ebx, %esi
callq 0x6ee6
movq %rax, %rbx
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
movq %r14, %rdi
callq 0x6d77
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/rept_irpc.c
// Function: rept_stream_gets
char           *rept_stream_gets(
    STREAM *str)
{
    REPT_STREAM    *rstr = (REPT_STREAM *) str;
    char           *cp;

    for (;;) {
        if ((cp = buffer_stream_gets(str)) != NULL)
            return cp;

        if (--rstr->count <= 0)
            return NULL;

        buffer_stream_rewind(str);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0xdbd4
testq %rax, %rax
jne 0x9708
xorl %ebx, %ebx
movl 0x30(%r14), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x30(%r14)
cmpl $0x2, %eax
jl 0x970b
movq %r14, %rdi
callq 0xdc5a
movq %r14, %rdi
callq 0xdbd4
testq %rax, %rax
je 0x96e3
movq %rax, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/rept_irpc.c
// Function: expand_rept
STREAM         *expand_rept(
    STACK *stack,
    char *cp)
{
    EX_TREE        *value;
    BUFFER         *gb;
    REPT_STREAM    *rstr;
    int             levelmod;

    value = parse_expr(cp, 0);
    if (value->type != EX_LIT) {
        report(stack->top, ".REPT value must be constant\n");
        free_tree(value);
        return NULL;
    }

    gb = new_buffer();

    levelmod = 0;
    if (!list_md) {
        list_level--;
        levelmod = 1;
    }

    read_body(stack, gb, NULL, FALSE);

    list_level += levelmod;

    rstr = memcheck(malloc(sizeof(REPT_STREAM))); {
        char           *name = memcheck(malloc(strlen(stack->top->name) + 32));

        sprintf(name, "%s:%d->.REPT", stack->top->name, stack->top->line);
        buffer_stream_construct(&rstr->bstr, gb, name);
        free(name);
    }

    rstr->count = value->data.lit;
    rstr->bstr.stream.vtbl = &rept_stream_vtbl;
    rstr->savecond = last_cond;

    buffer_free(gb);
    free_tree(value);

    return &rstr->bstr.stream;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
xorl %ebp, %ebp
movq %rsi, %rdi
xorl %esi, %esi
callq 0x8fc7
movq %rax, %rbx
cmpl $0x1, (%rax)
jne 0x981c
callq 0xda54
movq %rax, %r14
leaq 0xc314(%rip), %rax      # 0x15a74
cmpl $0x0, (%rax)
jne 0x9773
leaq 0xc314(%rip), %rax      # 0x15a80
decl (%rax)
movl $0x1, %ebp
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7c31
leaq 0xc2f7(%rip), %rax      # 0x15a80
addl %ebp, (%rax)
movl $0x38, %edi
callq 0x2230
movq %rax, %rdi
callq 0xe094
movq %rax, %r12
movq (%r15), %rax
movq 0x8(%rax), %rdi
callq 0x20e0
leaq 0x20(%rax), %rdi
callq 0x2230
movq %rax, %rdi
callq 0xe094
movq %rax, %r13
movq (%r15), %rax
movq 0x8(%rax), %rdx
movl 0x10(%rax), %ecx
leaq 0x6e82(%rip), %rsi      # 0x10653
movq %r13, %rdi
xorl %eax, %eax
callq 0x22b0
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xdc63
movq %r13, %rdi
callq 0x2050
movl 0x10(%rbx), %eax
movl %eax, 0x30(%r12)
leaq 0xc2a0(%rip), %rax      # 0x15aa0
movq %rax, (%r12)
leaq 0xdca5(%rip), %rax      # 0x174b0
movl (%rax), %eax
movl %eax, 0x34(%r12)
movq %r14, %rdi
callq 0xdac0
jmp 0x9830
movq (%r15), %rdi
leaq 0x6e0f(%rip), %rsi      # 0x10635
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x7a34
movq %rbx, %rdi
callq 0x6d77
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/rept_irpc.c
// Function: irp_stream_gets
char           *irp_stream_gets(
    STREAM *str)
{
    IRP_STREAM     *istr = (IRP_STREAM *) str;
    char           *cp;
    BUFFER         *buf;
    ARG            *arg;

    for (;;) {
        if ((cp = buffer_stream_gets(str)) != NULL)
            return cp;

        cp = istr->items + istr->offset;

        if (!*cp)
            return NULL;               /* No more items.  EOF. */

        arg = new_arg();
        arg->next = NULL;
        arg->locsym = 0;
        arg->label = istr->label;
        arg->value = getstring_macarg(str, cp, &cp);
        cp = skipdelim(cp);
        istr->offset = (int) (cp - istr->items);

        buf = subst_args(istr->body, arg);

        free(arg->value);
        free(arg);
        buffer_stream_set_buffer(&istr->bstr, buf);
        buffer_free(buf);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
callq 0xdbd4
testq %rax, %rax
jne 0x991f
xorl %ebx, %ebx
leaq 0x8(%rsp), %r15
movq 0x38(%r14), %rax
movslq 0x40(%r14), %rcx
leaq (%rax,%rcx), %rdx
movq %rdx, 0x8(%rsp)
cmpb $0x0, (%rax,%rcx)
je 0x9922
callq 0x80b2
movq %rax, %r12
movq $0x0, (%rax)
movl $0x0, 0x8(%rax)
movq 0x30(%r14), %rax
movq %rax, 0x10(%r12)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x82c4
movq %rax, 0x18(%r12)
movq 0x8(%rsp), %rdi
callq 0x875a
movq %rax, 0x8(%rsp)
subl 0x38(%r14), %eax
movl %eax, 0x40(%r14)
movq 0x48(%r14), %rdi
movq %r12, %rsi
callq 0x80dc
movq %rax, %r13
movq 0x18(%r12), %rdi
callq 0x2050
movq %r12, %rdi
callq 0x2050
movq %r14, %rdi
movq %r13, %rsi
callq 0xdca8
movq %r13, %rdi
callq 0xdac0
movq %r14, %rdi
callq 0xdbd4
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x986f
movq %rax, %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/rept_irpc.c
// Function: irp_stream_delete
void irp_stream_delete(
    STREAM *str)
{
    IRP_STREAM     *istr = (IRP_STREAM *) str;

    pop_cond(istr->savecond);          /* complete unterminated
                                          conditionals */

    buffer_free(istr->body);
    free(istr->items);
    free(istr->label);
    buffer_stream_delete(str);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x50(%rdi), %edi
callq 0x668c
movq 0x48(%rbx), %rdi
callq 0xdac0
movq 0x38(%rbx), %rdi
callq 0x2050
movq 0x30(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
jmp 0xdc3b
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/rept_irpc.c
// Function: expand_irp
STREAM         *expand_irp(
    STACK *stack,
    char *cp)
{
    char           *label,
                   *items;
    BUFFER         *gb;
    int             levelmod = 0;
    IRP_STREAM     *str;

    label = get_symbol(cp, &cp, NULL);
    if (!label) {
        report(stack->top, "Illegal .IRP syntax\n");
        return NULL;
    }

    cp = skipdelim(cp);

    items = getstring(cp, &cp);
    if (!items) {
        report(stack->top, "Illegal .IRP syntax\n");
        free(label);
        return NULL;
    }

    gb = new_buffer();

    levelmod = 0;
    if (!list_md) {
        list_level--;
        levelmod++;
    }

    read_body(stack, gb, NULL, FALSE);

    list_level += levelmod;

    str = memcheck(malloc(sizeof(IRP_STREAM))); {
        char           *name = memcheck(malloc(strlen(stack->top->name) + 32));

        sprintf(name, "%s:%d->.IRP", stack->top->name, stack->top->line);
        buffer_stream_construct(&str->bstr, NULL, name);
        free(name);
    }

    str->bstr.stream.vtbl = &irp_stream_vtbl;

    str->body = gb;
    str->items = items;
    str->offset = 0;
    str->label = label;
    str->savecond = last_cond;

    return &str->bstr.stream;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %r14
movq %rsp, %rsi
movq %rax, (%rsi)
movq %rax, %rdi
xorl %edx, %edx
callq 0x8af9
testq %rax, %rax
je 0x9a84
movq %rax, %rbx
movq %rsp, %r15
movq (%r15), %rdi
callq 0x875a
movq %rax, (%r15)
movq %rax, %rdi
movq %r15, %rsi
callq 0x87b7
testq %rax, %rax
je 0x9a9a
movq %rax, %r15
callq 0xda54
movq %rax, %r12
leaq 0xc0b0(%rip), %rax      # 0x15a74
xorl %ebp, %ebp
cmpl $0x0, (%rax)
jne 0x99d9
leaq 0xc0ae(%rip), %rax      # 0x15a80
decl (%rax)
movl $0x1, %ebp
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7c31
leaq 0xc091(%rip), %rax      # 0x15a80
addl %ebp, (%rax)
movl $0x58, %edi
callq 0x2230
movq %rax, %rdi
callq 0xe094
movq %rax, %r13
movq (%r14), %rax
movq 0x8(%rax), %rdi
callq 0x20e0
leaq 0x20(%rax), %rdi
callq 0x2230
movq %rax, %rdi
callq 0xe094
movq %rax, %rbp
movq (%r14), %rax
movq 0x8(%rax), %rdx
movl 0x10(%rax), %ecx
leaq 0x6c3e(%rip), %rsi      # 0x10675
movq %rbp, %rdi
xorl %eax, %eax
callq 0x22b0
movq %r13, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0xdc63
movq %rbp, %rdi
callq 0x2050
leaq 0xc05b(%rip), %rax      # 0x15ab8
movq %rax, (%r13)
movq %r12, 0x48(%r13)
movq %r15, 0x38(%r13)
movl $0x0, 0x40(%r13)
movq %rbx, 0x30(%r13)
leaq 0xda34(%rip), %rax      # 0x174b0
movl (%rax), %eax
movl %eax, 0x50(%r13)
jmp 0x9ab6
movq (%r14), %rdi
leaq 0x6bd2(%rip), %rsi      # 0x10660
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x7a34
jmp 0x9ab6
movq (%r14), %rdi
leaq 0x6bbc(%rip), %rsi      # 0x10660
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x7a34
movq %rbx, %rdi
callq 0x2050
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/rept_irpc.c
// Function: irpc_stream_gets
char           *irpc_stream_gets(
    STREAM *str)
{
    IRPC_STREAM    *istr = (IRPC_STREAM *) str;
    char           *cp;
    BUFFER         *buf;
    ARG            *arg;

    for (;;) {
        if ((cp = buffer_stream_gets(str)) != NULL)
            return cp;

        cp = istr->items + istr->offset;

        if (!*cp)
            return NULL;               /* No more items.  EOF. */

        arg = new_arg();
        arg->next = NULL;
        arg->locsym = 0;
        arg->label = istr->label;
        arg->value = memcheck(malloc(2));
        arg->value[0] = *cp++;
        arg->value[1] = 0;
        istr->offset = (int) (cp - istr->items);

        buf = subst_args(istr->body, arg);

        free(arg->value);
        free(arg);
        buffer_stream_set_buffer(&istr->bstr, buf);
        buffer_free(buf);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0xdbd4
testq %rax, %rax
jne 0x9b8d
xorl %ebx, %ebx
movq 0x38(%r14), %r12
movslq 0x40(%r14), %rax
cmpb $0x0, (%r12,%rax)
je 0x9b90
addq %rax, %r12
callq 0x80b2
movq %rax, %r15
movq $0x0, (%rax)
movl $0x0, 0x8(%rax)
movq 0x30(%r14), %rax
movq %rax, 0x10(%r15)
movl $0x2, %edi
callq 0x2230
movq %rax, %rdi
callq 0xe094
movq %rax, 0x18(%r15)
movb (%r12), %cl
movb %cl, (%rax)
movq 0x18(%r15), %rax
movb $0x0, 0x1(%rax)
movl 0x38(%r14), %eax
subl %eax, %r12d
incl %r12d
movl %r12d, 0x40(%r14)
movq 0x48(%r14), %rdi
movq %r15, %rsi
callq 0x80dc
movq %rax, %r12
movq 0x18(%r15), %rdi
callq 0x2050
movq %r15, %rdi
callq 0x2050
movq %r14, %rdi
movq %r12, %rsi
callq 0xdca8
movq %r12, %rdi
callq 0xdac0
movq %r14, %rdi
callq 0xdbd4
testq %rax, %rax
je 0x9ae3
movq %rax, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/rept_irpc.c
// Function: expand_irpc
STREAM         *expand_irpc(
    STACK *stack,
    char *cp)
{
    char           *label,
                   *items;
    BUFFER         *gb;
    int             levelmod = 0;
    IRPC_STREAM    *str;

    label = get_symbol(cp, &cp, NULL);
    if (!label) {
        report(stack->top, "Illegal .IRPC syntax\n");
        return NULL;
    }

    cp = skipdelim(cp);

    items = getstring(cp, &cp);
    if (!items) {
        report(stack->top, "Illegal .IRPC syntax\n");
        free(label);
        return NULL;
    }

    gb = new_buffer();

    levelmod = 0;
    if (!list_md) {
        list_level--;
        levelmod++;
    }

    read_body(stack, gb, NULL, FALSE);

    list_level += levelmod;

    str = memcheck(malloc(sizeof(IRPC_STREAM))); {
        char           *name = memcheck(malloc(strlen(stack->top->name) + 32));

        sprintf(name, "%s:%d->.IRPC", stack->top->name, stack->top->line);
        buffer_stream_construct(&str->bstr, NULL, name);
        free(name);
    }

    str->bstr.stream.vtbl = &irpc_stream_vtbl;
    str->body = gb;
    str->items = items;
    str->offset = 0;
    str->label = label;
    str->savecond = last_cond;

    return &str->bstr.stream;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %r14
movq %rsp, %rsi
movq %rax, (%rsi)
movq %rax, %rdi
xorl %edx, %edx
callq 0x8af9
testq %rax, %rax
je 0x9cf0
movq %rax, %rbx
movq %rsp, %r15
movq (%r15), %rdi
callq 0x875a
movq %rax, (%r15)
movq %rax, %rdi
movq %r15, %rsi
callq 0x87b7
testq %rax, %rax
je 0x9d06
movq %rax, %r15
callq 0xda54
movq %rax, %r12
leaq 0xbe44(%rip), %rax      # 0x15a74
xorl %ebp, %ebp
cmpl $0x0, (%rax)
jne 0x9c45
leaq 0xbe42(%rip), %rax      # 0x15a80
decl (%rax)
movl $0x1, %ebp
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7c31
leaq 0xbe25(%rip), %rax      # 0x15a80
addl %ebp, (%rax)
movl $0x58, %edi
callq 0x2230
movq %rax, %rdi
callq 0xe094
movq %rax, %r13
movq (%r14), %rax
movq 0x8(%rax), %rdi
callq 0x20e0
leaq 0x20(%rax), %rdi
callq 0x2230
movq %rax, %rdi
callq 0xe094
movq %rax, %rbp
movq (%r14), %rax
movq 0x8(%rax), %rdx
movl 0x10(%rax), %ecx
leaq 0x69f4(%rip), %rsi      # 0x10697
movq %rbp, %rdi
xorl %eax, %eax
callq 0x22b0
movq %r13, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0xdc63
movq %rbp, %rdi
callq 0x2050
leaq 0xbe07(%rip), %rax      # 0x15ad0
movq %rax, (%r13)
movq %r12, 0x48(%r13)
movq %r15, 0x38(%r13)
movl $0x0, 0x40(%r13)
movq %rbx, 0x30(%r13)
leaq 0xd7c8(%rip), %rax      # 0x174b0
movl (%rax), %eax
movl %eax, 0x50(%r13)
jmp 0x9d22
movq (%r14), %rdi
leaq 0x6987(%rip), %rsi      # 0x10681
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x7a34
jmp 0x9d22
movq (%r14), %rdi
leaq 0x6971(%rip), %rsi      # 0x10681
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x7a34
movq %rbx, %rdi
callq 0x2050
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/symbols.c
// Function: hash_name
int hash_name(
    char *label)
{
    unsigned        accum = 0;

    while (*label)
        accum = (accum << 1) ^ *label++;

    accum %= HASH_SIZE;

    return accum;
}

// Assembly:
movb (%rdi), %al
testb %al, %al
je 0x9d73
incq %rdi
xorl %ecx, %ecx
movl %ecx, %edx
addl %ecx, %edx
movsbl %al, %ecx
xorl %edx, %ecx
movb (%rdi), %al
incq %rdi
testb %al, %al
jne 0x9d3f
movl %ecx, %eax
imulq $0x401005, %rax, %rdx   # imm = 0x401005
shrq $0x20, %rdx
movl %ecx, %eax
subl %edx, %eax
shrl %eax
addl %edx, %eax
shrl $0x9, %eax
movl %eax, %edx
shll $0xa, %edx
subl %edx, %eax
addl %ecx, %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/symbols.c
// Function: symflags
char           *symflags(
    SYMBOL *sym)
{
    static char     temp[8];
    char           *fp = temp;

    if (sym->flags & SYMBOLFLAG_GLOBAL)
        *fp++ = 'G';
    if (sym->flags & SYMBOLFLAG_PERMANENT)
        *fp++ = 'P';
    if (sym->flags & SYMBOLFLAG_DEFINITION)
        *fp++ = 'D';
    *fp = 0;
    return fp;
}

// Assembly:
movl 0x10(%rdi), %ecx
testb $0x2, %cl
jne 0x9d87
leaq 0xd8ff(%rip), %rax      # 0x17684
jmp 0x9d95
movb $0x47, 0xd8f6(%rip)     # 0x17684
leaq 0xd8f0(%rip), %rax      # 0x17685
testb $0x1, %cl
je 0x9da0
movb $0x50, (%rax)
incq %rax
testb $0x8, %cl
je 0x9dab
movb $0x44, (%rax)
incq %rax
movb $0x0, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/symbols.c
// Function: remove_sym
void remove_sym(
    SYMBOL *sym,
    SYMBOL_TABLE *table)
{
    SYMBOL        **prevp,
                   *symp;
    int             hash;

    hash = hash_name(sym->label);
    prevp = &table->hash[hash];
    while (symp = *prevp, symp != NULL && symp != sym)
        prevp = &symp->next;

    if (symp)
        *prevp = sym->next;
}

// Assembly:
movq (%rdi), %rcx
movb (%rcx), %dl
xorl %eax, %eax
testb %dl, %dl
je 0x9e0d
incq %rcx
movl %eax, %r8d
addl %eax, %r8d
movsbl %dl, %eax
xorl %r8d, %eax
movb (%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0x9dd7
movl %eax, %ecx
imulq $0x401005, %rcx, %rcx   # imm = 0x401005
shrq $0x20, %rcx
movl %eax, %edx
subl %ecx, %edx
shrl %edx
addl %ecx, %edx
shrl $0x9, %edx
movl %edx, %ecx
shll $0xa, %ecx
subl %ecx, %edx
addl %edx, %eax
leaq (%rsi,%rax,8), %rdx
movq %rdx, %rax
movq (%rdx), %rcx
testq %rcx, %rcx
je 0x9e25
leaq 0x20(%rcx), %rdx
cmpq %rdi, %rcx
jne 0x9e11
testq %rcx, %rcx
je 0x9e31
movq 0x20(%rdi), %rcx
movq %rcx, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/symbols.c
// Function: lookup_sym
SYMBOL         *lookup_sym(
    char *label,
    SYMBOL_TABLE *table)
{
    unsigned        hash;
    SYMBOL         *sym;

    hash = hash_name(label);

    sym = table->hash[hash];
    while (sym && strcmp(sym->label, label) != 0)
        sym = sym->next;

    return sym;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb (%rdi), %cl
xorl %eax, %eax
testb %cl, %cl
je 0x9e78
leaq 0x1(%rbx), %rdx
movl %eax, %edi
addl %eax, %edi
movsbl %cl, %eax
xorl %edi, %eax
movb (%rdx), %cl
incq %rdx
testb %cl, %cl
jne 0x9e45
movl %eax, %ecx
imulq $0x401005, %rcx, %rcx   # imm = 0x401005
shrq $0x20, %rcx
movl %eax, %edx
subl %ecx, %edx
shrl %edx
addl %ecx, %edx
shrl $0x9, %edx
movl %edx, %ecx
shll $0xa, %ecx
subl %ecx, %edx
addl %edx, %eax
movq (%rsi,%rax,8), %r14
testq %r14, %r14
je 0x9e96
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x21d0
testl %eax, %eax
je 0x9e99
movq 0x20(%r14), %r14
jmp 0x9e7c
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/symbols.c
// Function: next_sym
SYMBOL         *next_sym(
    SYMBOL_TABLE *table,
    SYMBOL_ITER *iter)
{
    if (iter->current)
        iter->current = iter->current->next;

    while (iter->current == NULL) {
        if (iter->subscript >= HASH_SIZE)
            return NULL;               /* No more symbols. */
        iter->current = table->hash[iter->subscript];
        iter->subscript++;
    }

    return iter->current;              /* Got a symbol. */
}

// Assembly:
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x9eba
movq 0x20(%rax), %rax
movq %rax, 0x8(%rsi)
testq %rax, %rax
jne 0x9ef3
movslq (%rsi), %rax
cmpl $0x400, %eax            # imm = 0x400
movl $0x3ff, %ecx            # imm = 0x3FF
cmovgel %eax, %ecx
subq %rax, %rcx
leaq (%rdi,%rax,8), %rdx
leal 0x1(%rax), %edi
xorl %r8d, %r8d
cmpq %r8, %rcx
je 0x9ef4
movq (%rdx,%r8,8), %rax
movq %rax, 0x8(%rsi)
leal (%rdi,%r8), %r9d
movl %r9d, (%rsi)
incq %r8
testq %rax, %rax
je 0x9ed7
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/symbols.c
// Function: sym_hist
void sym_hist(
    SYMBOL_TABLE *st,
    char *name)
{
    int             i;
    SYMBOL         *sym;

    fprintf(lstfile, "Histogram for symbol table %s\n", name);
    for (i = 0; i < 1023; i++) {
        fprintf(lstfile, "%4d: ", i);
        for (sym = st->hash[i]; sym != NULL; sym = sym->next)
            fputc('#', lstfile);
        fputc('\n', lstfile);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0xbeaf(%rip), %r12      # 0x17660
movq (%r12), %rdi
leaq 0x5306(%rip), %rsi      # 0x10ac2
xorl %eax, %eax
callq 0x21e0
leaq 0x5317(%rip), %r14      # 0x10ae1
xorl %r15d, %r15d
movq (%r12), %rdi
movq %r14, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x21e0
movq (%rbx,%r15,8), %r13
testq %r13, %r13
je 0xb7fb
movq (%r12), %rsi
movl $0x23, %edi
callq 0x2170
movq 0x20(%r13), %r13
jmp 0xb7e2
movq (%r12), %rsi
movl $0xa, %edi
callq 0x2170
incq %r15
cmpq $0x3ff, %r15            # imm = 0x3FF
jne 0xb7cd
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/symbols.c
// Function: list_section
void list_section(
    SECTION *sec)
{
    if (sec == NULL) {
        fprintf(lstfile, "(null)\n");
        return;
    }

    int flags = sec->flags;

    fprintf(lstfile, "%-6s  %06o    %03d   ",
        sec->label, sec->size & 0177777, sec->sector);
    fprintf(lstfile, "(%s,%s,%s,%s,%s,%s)\n",
        (flags & PSECT_RO)   ? "RO"  : "RW",
        (flags & PSECT_DATA) ? "D"   : "I",
        (flags & PSECT_GBL)  ? "GBL" : "LCL",
        (flags & PSECT_REL)  ? "REL" : "ABS",
        (flags & PSECT_COM)  ? "OVR" : "CON",
        (flags & PSECT_SAV)  ? "SAV" : "NOSAV");
}

// Assembly:
testq %rdi, %rdi
je 0xbcba
pushq %rbp
pushq %rbx
pushq %rax
movl 0xc(%rdi), %ebp
leaq 0xba78(%rip), %rbx      # 0x17660
movq (%rbx), %rax
movq (%rdi), %rdx
movzwl 0x14(%rdi), %ecx
movl 0x18(%rdi), %r8d
leaq 0x4f39(%rip), %rsi      # 0x10b36
movq %rax, %rdi
xorl %eax, %eax
callq 0x21e0
testb $0x10, %bpl
leaq 0x4f4f(%rip), %rax      # 0x10b61
leaq 0x4c03(%rip), %rdx      # 0x1081c
cmoveq %rax, %rdx
testb %bpl, %bpl
leaq 0x4e5c(%rip), %rax      # 0x10a83
leaq 0x4e83(%rip), %rcx      # 0x10ab1
cmovnsq %rax, %rcx
movd %ebp, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
pand 0x4a6d(%rip), %xmm0     # 0x106b0
pxor %xmm1, %xmm1
pcmpeqd %xmm0, %xmm1
movmskps %xmm1, %eax
leaq 0x4289(%rip), %rsi      # 0xfede
leaq 0x3d21(%rip), %r8       # 0xf97d
testb $0x8, %al
cmovneq %rsi, %r8
movq (%rbx), %rdi
leaq 0x425c(%rip), %rsi      # 0xfec8
leaq 0x4259(%rip), %r9       # 0xfecc
testb $0x4, %al
cmovneq %rsi, %r9
leaq 0x425a(%rip), %rsi      # 0xfeda
leaq 0x424f(%rip), %r10      # 0xfed6
testb $0x2, %al
cmovneq %rsi, %r10
leaq 0x423c(%rip), %rsi      # 0xfed0
leaq 0x4237(%rip), %r11      # 0xfed2
testb $0x1, %al
cmovneq %rsi, %r11
leaq 0x4ea4(%rip), %rsi      # 0x10b4c
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x21e0
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
leaq 0xb99f(%rip), %rax      # 0x17660
movq (%rax), %rcx
leaq 0x4e63(%rip), %rdi      # 0x10b2e
movl $0x7, %esi
movl $0x1, %edx
jmp 0x22d0
nop
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/mlb-rsx.c
// Function: mlb_close
void mlb_close(
    MLB *mlb)
{
    if (mlb) {
        int             i;

        if (mlb->directory) {
            for (i = 0; i < mlb->nentries; i++)
                if (mlb->directory[i].label)
                    free(mlb->directory[i].label);
            free(mlb->directory);
        }
        if (mlb->fp)
            fclose(mlb->fp);

        free(mlb);
    }
}

// Assembly:
testq %rdi, %rdi
je 0xc073
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0xc059
movl 0x10(%rbx), %eax
testl %eax, %eax
jle 0xc054
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rcx
movq (%rcx,%r14), %rdi
testq %rdi, %rdi
je 0xc041
callq 0x2050
movl 0x10(%rbx), %eax
incq %r15
movslq %eax, %rcx
addq $0x18, %r14
cmpq %rcx, %r15
jl 0xc02c
movq 0x8(%rbx), %rdi
callq 0x2050
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xc066
callq 0x20d0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/mlb-rsx.c
// Function: mlb_extract
void mlb_extract(
    MLB *mlb)
{
    int             i;
    FILE           *fp;
    BUFFER         *buf;

    for (i = 0; i < mlb->nentries; i++) {
        char            name[32];

        buf = mlb_entry(mlb, mlb->directory[i].label);
        if (buf != NULL) {
            char *suffix = mlb->is_objlib ? "OBJ" : "MAC";
            sprintf(name, "%s.%s", mlb->directory[i].label, suffix);
            fp = fopen(name, "w");
            int length = buf->length;
            fwrite(buf->buffer, 1, length, fp);
            fclose(fp);
            buffer_free(buf);
        }
    }
}

// Assembly:
cmpl $0x0, 0x10(%rdi)
jle 0xc346
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq %rsp, %r15
xorl %r14d, %r14d
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movq (%rax,%r14), %rsi
movq %rbx, %rdi
callq 0xc074
testq %rax, %rax
je 0xc324
movq %rax, %r13
cmpl $0x0, 0x14(%rbx)
leaq 0x495b(%rip), %rcx      # 0x10c24
leaq 0x3b5f(%rip), %rax      # 0xfe2f
cmoveq %rax, %rcx
movq 0x8(%rbx), %rax
movq (%rax,%r14), %rdx
movq %r15, %rdi
leaq 0x4942(%rip), %rsi      # 0x10c28
xorl %eax, %eax
callq 0x22b0
movq %r15, %rdi
leaq 0x2e9d(%rip), %rsi      # 0xf194
callq 0x2270
movq %rax, %rbp
movslq 0xc(%r13), %rdx
movq (%r13), %rdi
movl $0x1, %esi
movq %rax, %rcx
callq 0x22d0
movq %rbp, %rdi
callq 0x20d0
movq %r13, %rdi
callq 0xdac0
incq %r12
movslq 0x10(%rbx), %rax
addq $0x18, %r14
cmpq %rax, %r12
jl 0xc2a6
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/object.c
// Function: gsd_flush
int gsd_flush(
    GSD * gsd)
{
    if (gsd->offset > 2) {
        if (!writerec(gsd->fp, gsd->buf, gsd->offset))
            return 0;
        gsd_init(gsd, gsd->fp);
    }
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x84(%rdi), %edx
movl $0x1, %ebx
cmpl $0x3, %edx
jl 0xc399
movq %rdi, %r14
movq (%rdi), %rdi
leaq 0x8(%r14), %rsi
callq 0xc3a3
testl %eax, %eax
je 0xc397
movw $0x1, 0x8(%r14)
movl $0x2, 0x84(%r14)
jmp 0xc399
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/object.c
// Function: gsd_write
static int gsd_write(
    GSD * gsd,
    char *name,
    int flags,
    int type,
    int value)
{
    char           *cp;
    unsigned        radtbl[2];

    if (gsd->offset > (int)sizeof(gsd->buf) - 8) {
        if (!gsd_flush(gsd))
            return 0;
    }

    rad50x2(name, radtbl);

    cp = gsd->buf + gsd->offset;
    *cp++ = radtbl[0] & 0xff;
    *cp++ = (radtbl[0] >> 8) & 0xff;
    *cp++ = radtbl[1] & 0xff;
    *cp++ = (radtbl[1] >> 8) & 0xff;

    *cp++ = flags;
    *cp++ = type;

    *cp++ = value & 0xff;
    *cp = (value >> 8) & 0xff;

    gsd->offset += 8;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r13d
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
cmpl $0x73, 0x84(%rdi)
jl 0xc450
movq %rbx, %rdi
callq 0xc35c
testl %eax, %eax
je 0xc4ac
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xe38f
movslq 0x84(%rbx), %rax
movzwl (%r12), %ecx
movw %cx, 0x8(%rbx,%rax)
movl 0x4(%r12), %ecx
movb %cl, 0xa(%rbx,%rax)
movb %ch, 0xb(%rbx,%rax)
movb %r14b, 0xc(%rbx,%rax)
movb %bpl, 0xd(%rbx,%rax)
movl %r13d, %ecx
movb %cl, 0xe(%rbx,%rax)
movb %ch, 0xf(%rbx,%rax)
addl $0x8, 0x84(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0xc49d
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_flush
int text_flush(
    TEXT_RLD *tr)
{
    if (tr->txt_offset > 4) {
        if (!writerec(tr->fp, tr->text, tr->txt_offset))
            return 0;
    }

    if (tr->rld_offset > 2) {
        if (!writerec(tr->fp, tr->rld, tr->rld_offset))
            return 0;
    }

    return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x8c(%rdi), %edx
cmpl $0x5, %edx
jl 0xc581
movq (%rbx), %rdi
leaq 0x8(%rbx), %rsi
callq 0xc3a3
testl %eax, %eax
je 0xc5a9
movl 0x110(%rbx), %edx
cmpl $0x3, %edx
jl 0xc5a2
movq (%rbx), %rdi
addq $0x90, %rbx
movq %rbx, %rsi
callq 0xc3a3
testl %eax, %eax
je 0xc5a9
movl $0x1, %eax
jmp 0xc5ab
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_word
int text_word(
    TEXT_RLD *tr,
    unsigned *addr,
    int size,
    unsigned word)
{
    if (!text_fit(tr, *addr, size, 0))
        return 0;

    text_word_i(tr, word, size);

    *addr += size;                     /* Update the caller's DOT */
    return 1;                          /* say "ok". */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r12d
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %rbp
movl (%rsi), %esi
xorl %r15d, %r15d
xorl %ecx, %ecx
callq 0xc615
testl %eax, %eax
je 0xc609
movslq 0x8c(%rbp), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x8c(%rbp)
movl %r12d, %edx
movb %dl, 0x8(%rbp,%rax)
cmpl $0x2, %ebx
jl 0xc600
movslq 0x8c(%rbp), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x8c(%rbp)
movb %dh, 0x8(%rbp,%rax)
addl %ebx, (%r14)
movl $0x1, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_fit
static int text_fit(
    TEXT_RLD *tr,
    unsigned addr,
    int txtsize,
    int rldsize)
{
    if (tr->txt_offset + txtsize <= (int)sizeof(tr->text) &&
        tr->rld_offset + rldsize <= (int)sizeof(tr->rld) &&
        (txtsize == 0 || tr->txt_addr + tr->txt_offset - 4 == addr))
        return 1;                      /* All's well. */

    if (!text_flush(tr))
        return 0;
    text_init(tr, tr->fp, addr);

    return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0x8c(%rdi), %esi
leal (%rsi,%rdx), %eax
cmpl $0x80, %eax
jg 0xc653
addl 0x110(%rbx), %ecx
cmpl $0x80, %ecx
jg 0xc653
movl $0x1, %eax
testl %edx, %edx
je 0xc699
movl 0x88(%rbx), %ecx
addl %esi, %ecx
addl $-0x4, %ecx
cmpl %ebp, %ecx
je 0xc699
movq %rbx, %rdi
callq 0xc562
testl %eax, %eax
je 0xc697
movw $0x3, 0x8(%rbx)
movl %ebp, %eax
movb %al, 0xa(%rbx)
movb %ah, 0xb(%rbx)
movl $0x4, 0x8c(%rbx)
movw $0x4, 0x90(%rbx)
movl %ebp, 0x88(%rbx)
movl $0x2, 0x110(%rbx)
movl $0x1, %eax
jmp 0xc699
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_internal_word
int text_internal_word(
    TEXT_RLD *tr,
    unsigned *addr,
    int size,
    unsigned word)
{
    if (!text_fit(tr, *addr, size, 4))
        return 0;

    text_word_i(tr, word, size);
    rld_code(tr, RLD_INT, *addr, size);
    rld_word(tr, word);

    *addr += size;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl (%rsi), %esi
movl $0x4, %ecx
callq 0xc615
testl %eax, %eax
je 0xc782
movslq 0x8c(%r15), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x8c(%r15)
movb %bpl, 0x8(%r15,%rax)
movl %ebp, %eax
shrl $0x8, %eax
cmpl $0x2, %ebx
jl 0xc6fb
movslq 0x8c(%r15), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x8c(%r15)
movb %al, 0x8(%r15,%rcx)
movl (%r14), %ecx
subl 0x88(%r15), %ecx
cmpl $0x1, %ebx
setne %dl
shlb $0x7, %dl
addb $-0x7f, %dl
movslq 0x110(%r15), %rsi
leal 0x1(%rsi), %edi
movl %edi, 0x110(%r15)
movb %dl, 0x90(%r15,%rsi)
addb $0x4, %cl
movslq 0x110(%r15), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x110(%r15)
movb %cl, 0x90(%r15,%rdx)
movslq 0x110(%r15), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x110(%r15)
movb %bpl, 0x90(%r15,%rcx)
movslq 0x110(%r15), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x110(%r15)
movb %al, 0x90(%r15,%rcx)
addl %ebx, (%r14)
movl $0x1, %eax
jmp 0xc784
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq