LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_complex_global
int text_complex_global(
    TEXT_COMPLEX *tx,
    char *name)
{
    unsigned        radtbl[2];
    char           *cp = text_complex_fit(tx, 5);

    if (!cp)
        return 0;

    rad50x2(name, radtbl);
    *cp++ = CPLX_GLOBAL;
    *cp++ = radtbl[0] & 0xff;
    *cp++ = (radtbl[0] >> 8) & 0xff;
    *cp++ = radtbl[1] & 0xff;
    *cp = (radtbl[1] >> 8) & 0xff;
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movslq 0x80(%rdi), %rcx
xorl %eax, %eax
cmpq $0x79, %rcx
jle 0xda41
xorl %ebx, %ebx
jmp 0xda50
movq %rdi, %rbx
leal 0x5(%rcx), %edx
movl %edx, 0x80(%rdi)
addq %rcx, %rbx
testq %rbx, %rbx
je 0xda7c
movq %rsp, %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0xe63f
movb $0xe, (%rbx)
movzwl (%r14), %eax
movw %ax, 0x1(%rbx)
movzwl 0x4(%r14), %eax
movw %ax, 0x3(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_complex_psect
int text_complex_psect(
    TEXT_COMPLEX *tx,
    unsigned sect,
    unsigned offset)
{
    char           *cp = text_complex_fit(tx, 4);

    if (!cp)
        return 0;
    *cp++ = CPLX_REL;
    *cp++ = sect & 0xff;
    *cp++ = offset & 0xff;
    *cp = (offset >> 8) & 0xff;
    return 1;
}

// Assembly:
movslq 0x80(%rdi), %rcx
xorl %eax, %eax
cmpq $0x7a, %rcx
jle 0xda97
xorl %edi, %edi
jmp 0xdaa5
leal 0x4(%rcx), %r8d
movl %r8d, 0x80(%rdi)
addq %rcx, %rdi
testq %rdi, %rdi
je 0xdabc
movb $0xf, (%rdi)
movb %sil, 0x1(%rdi)
movb %dl, 0x2(%rdi)
movb %dh, 0x3(%rdi)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_complex_commit
int text_complex_commit(
    TEXT_RLD *tr,
    unsigned *addr,
    int size,
    TEXT_COMPLEX *tx,
    unsigned word)
{
    int             i;

    text_complex_byte(tx, CPLX_STORE);

    if (!text_fit(tr, *addr, size, tx->len + 2))
        return 0;

    rld_code(tr, RLD_COMPLEX, *addr, size);

    for (i = 0; i < tx->len; i++)
        rld_byte(tr, tx->accum[i]);

    text_word_i(tr, word, size);

    *addr += size;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %r12d
movq %rcx, %r15
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %rbp
movslq 0x80(%rcx), %rax
cmpq $0x7d, %rax
jle 0xdae4
xorl %eax, %eax
jmp 0xdaf1
leal 0x1(%rax), %ecx
movl %ecx, 0x80(%r15)
addq %r15, %rax
testq %rax, %rax
je 0xdaf9
movb $0xa, (%rax)
movl (%r14), %esi
movl 0x80(%r15), %ecx
addl $0x2, %ecx
movq %rbp, %rdi
movl %ebx, %edx
callq 0xc87d
testl %eax, %eax
je 0xdbcd
movl (%r14), %eax
subl 0x88(%rbp), %eax
cmpl $0x1, %ebx
setne %cl
shlb $0x7, %cl
addb $-0x71, %cl
movslq 0x110(%rbp), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x110(%rbp)
movb %cl, 0x90(%rbp,%rdx)
addb $0x4, %al
movslq 0x110(%rbp), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x110(%rbp)
movb %al, 0x90(%rbp,%rcx)
cmpl $0x0, 0x80(%r15)
jle 0xdb93
xorl %eax, %eax
movb (%r15,%rax), %cl
movslq 0x110(%rbp), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x110(%rbp)
movb %cl, 0x90(%rbp,%rdx)
incq %rax
movslq 0x80(%r15), %rcx
cmpq %rcx, %rax
jl 0xdb69
movslq 0x8c(%rbp), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x8c(%rbp)
movl %r12d, %edx
movb %dl, 0x8(%rbp,%rax)
cmpl $0x2, %ebx
jl 0xdbc3
movslq 0x8c(%rbp), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x8c(%rbp)
movb %dh, 0x8(%rbp,%rax)
addl %ebx, (%r14)
movl $0x1, %eax
jmp 0xdbcf
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_complex_commit_displaced
int text_complex_commit_displaced(
    TEXT_RLD *tr,
    unsigned *addr,
    int size,
    TEXT_COMPLEX *tx,
    unsigned word)
{
    int             i;

    text_complex_byte(tx, CPLX_STORE_DISP);

    if (!text_fit(tr, *addr, size, tx->len + 2))
        return 0;

    rld_code(tr, RLD_COMPLEX, *addr, size);

    for (i = 0; i < tx->len; i++)
        rld_byte(tr, tx->accum[i]);

    text_word_i(tr, word, size);

    *addr += size;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %r12d
movq %rcx, %r15
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %rbp
movslq 0x80(%rcx), %rax
cmpq $0x7d, %rax
jle 0xdbff
xorl %eax, %eax
jmp 0xdc0c
leal 0x1(%rax), %ecx
movl %ecx, 0x80(%r15)
addq %r15, %rax
testq %rax, %rax
je 0xdc14
movb $0xb, (%rax)
movl (%r14), %esi
movl 0x80(%r15), %ecx
addl $0x2, %ecx
movq %rbp, %rdi
movl %ebx, %edx
callq 0xc87d
testl %eax, %eax
je 0xdce8
movl (%r14), %eax
subl 0x88(%rbp), %eax
cmpl $0x1, %ebx
setne %cl
shlb $0x7, %cl
addb $-0x71, %cl
movslq 0x110(%rbp), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x110(%rbp)
movb %cl, 0x90(%rbp,%rdx)
addb $0x4, %al
movslq 0x110(%rbp), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x110(%rbp)
movb %al, 0x90(%rbp,%rcx)
cmpl $0x0, 0x80(%r15)
jle 0xdcae
xorl %eax, %eax
movb (%r15,%rax), %cl
movslq 0x110(%rbp), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x110(%rbp)
movb %cl, 0x90(%rbp,%rdx)
incq %rax
movslq 0x80(%r15), %rcx
cmpq %rcx, %rax
jl 0xdc84
movslq 0x8c(%rbp), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x8c(%rbp)
movl %r12d, %edx
movb %dl, 0x8(%rbp,%rax)
cmpl $0x2, %ebx
jl 0xdcde
movslq 0x8c(%rbp), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x8c(%rbp)
movb %dh, 0x8(%rbp,%rax)
addl %ebx, (%r14)
movl $0x1, %eax
jmp 0xdcea
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: new_buffer
BUFFER         *new_buffer(
    void)
{
    BUFFER         *buf = memcheck(malloc(sizeof(BUFFER)));

    buf->length = 0;
    buf->size = 0;
    buf->use = 1;
    buf->buffer = NULL;
    return buf;
}

// Assembly:
pushq %rax
movl $0x18, %edi
callq 0x2230
movq %rax, %rdi
callq 0xe34f
movl $0x1, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: buffer_resize
void buffer_resize(
    BUFFER *buff,
    int size)
{
    buff->size = size;
    buff->length = size;

    if (size == 0) {
        free(buff->buffer);
        buff->buffer = NULL;
    } else {
        if (buff->buffer == NULL)
            buff->buffer = memcheck(malloc(buff->size));
        else
            buff->buffer = memcheck(realloc(buff->buffer, buff->size));
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, 0x8(%rdi)
movl %esi, 0xc(%rdi)
movq (%rdi), %rdi
testl %esi, %esi
je 0xdd4e
movslq %esi, %rsi
testq %rdi, %rdi
je 0xdd57
callq 0x2260
jmp 0xdd5f
callq 0x2050
xorl %eax, %eax
jmp 0xdd67
movq %rsi, %rdi
callq 0x2230
movq %rax, %rdi
callq 0xe34f
movq %rax, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: buffer_free
void buffer_free(
    BUFFER *buf)
{
    if (buf) {
        if (--(buf->use) == 0) {
            free(buf->buffer);
            free(buf);
        }
    }
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0xdd86
movq %rdi, %rbx
decl 0x10(%rdi)
je 0xdd88
popq %rbx
retq
movq (%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: buffer_appendn
void buffer_appendn(
    BUFFER *buf,
    char *str,
    int len)
{
    int             needed = buf->length + len + 1;

    if (needed >= buf->size) {
        buf->size = needed + GROWBUF_INCR;

        if (buf->buffer == NULL)
            buf->buffer = memcheck(malloc(buf->size));
        else
            buf->buffer = memcheck(realloc(buf->buffer, buf->size));
    }

    memcpy(buf->buffer + buf->length, str, len);
    buf->length += len;
    buf->buffer[buf->length] = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movslq 0xc(%rdi), %rsi
movslq %edx, %r14
addq %r14, %rsi
leal 0x1(%rsi), %eax
cmpl 0x8(%rdi), %eax
jl 0xdde2
addq $0x401, %rsi            # imm = 0x401
movl %esi, 0x8(%rbx)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xddcf
callq 0x2260
jmp 0xddd7
movq %rsi, %rdi
callq 0x2230
movq %rax, %rdi
callq 0xe34f
movq %rax, (%rbx)
movslq 0xc(%rbx), %rdi
addq (%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2220
movslq 0xc(%rbx), %rax
addq %r14, %rax
movl %eax, 0xc(%rbx)
movq (%rbx), %rcx
movb $0x0, (%rcx,%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: stream_construct
void stream_construct(
    STREAM *str,
    char *name)
{
    str->line = 0;
    str->name = memcheck(strdup(name));
    str->next = NULL;
    str->vtbl = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x0, 0x10(%rdi)
movq %rsi, %rdi
callq 0x22e0
movq %rax, %rdi
callq 0xe34f
movq %rax, 0x8(%rbx)
xorl %eax, %eax
movq %rax, 0x18(%rbx)
movq %rax, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: buffer_stream_gets
char           *buffer_stream_gets(
    STREAM *str)
{
    char           *nl;
    char           *cp;
    BUFFER_STREAM  *bstr = (BUFFER_STREAM *) str;
    BUFFER         *buf = bstr->buffer;

    if (buf == NULL)
        return NULL;                   /* No buffer */

    if (bstr->offset >= buf->length)
        return NULL;

    cp = buf->buffer + bstr->offset;

    /* Find the next line in preparation for the next call */

    nl = memchr(cp, '\n', buf->length - bstr->offset);

    if (nl)
        nl++;

    bstr->offset = (int) (nl - buf->buffer);
    str->line++;

    return cp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0xdede
movq %rdi, %rbx
movslq 0x28(%rdi), %rcx
movl 0xc(%rax), %edx
xorl %r14d, %r14d
cmpl %ecx, %edx
jle 0xdee1
movq (%rax), %r12
movq %rcx, %r15
addq %r12, %r15
subl %ecx, %edx
movslq %edx, %rdx
movq %r15, %rdi
movl $0xa, %esi
callq 0x21a0
leal 0x1(%rax), %ecx
testq %rax, %rax
cmovel %r14d, %ecx
subl %r12d, %ecx
movl %ecx, 0x28(%rbx)
incl 0x10(%rbx)
movq %r15, %r14
jmp 0xdee1
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: buffer_stream_construct
void buffer_stream_construct(
    BUFFER_STREAM * bstr,
    BUFFER *buf,
    char *name)
{
    bstr->stream.vtbl = &buffer_stream_vtbl;

    bstr->stream.name = memcheck(strdup(name));

    bstr->buffer = buffer_clone(buf);
    bstr->offset = 0;
    bstr->stream.line = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7bc7(%rip), %rax      # 0x15af0
movq %rax, (%rdi)
movq %rdx, %rdi
callq 0x22e0
movq %rax, %rdi
callq 0xe34f
movq %rax, 0x8(%rbx)
testq %r14, %r14
je 0xdf49
incl 0x10(%r14)
movq %r14, 0x20(%rbx)
xorl %eax, %eax
movl %eax, 0x28(%rbx)
movl %eax, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: buffer_stream_set_buffer
void buffer_stream_set_buffer(
    BUFFER_STREAM * bstr,
    BUFFER *buf)
{
    if (bstr->buffer)
        buffer_free(bstr->buffer);
    bstr->buffer = buffer_clone(buf);
    bstr->offset = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0xdf75
callq 0xdd78
testq %r14, %r14
je 0xdf7e
incl 0x10(%r14)
movq %r14, 0x20(%rbx)
movl $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: file_destroy
void file_destroy(
    STREAM *str)
{
    FILE_STREAM    *fstr = (FILE_STREAM *) str;

    fclose(fstr->fp);
    free(fstr->buffer);
    stream_delete(str);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x20d0
movq 0x28(%rbx), %rdi
callq 0x2050
movq 0x8(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: new_file_stream
STREAM         *new_file_stream(
    char *filename)
{
    FILE           *fp;
    FILE_STREAM    *str;

    fp = fopen(filename, "r");
    if (fp == NULL)
        return NULL;

    str = memcheck(malloc(sizeof(FILE_STREAM)));

    str->stream.vtbl = &file_stream_vtbl;
    str->stream.name = memcheck(strdup(filename));
    str->buffer = memcheck(malloc(STREAM_BUFFER_SIZE));
    str->fp = fp;
    str->stream.line = 0;

    return &str->stream;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
leaq 0x2c0a(%rip), %rsi      # 0x10c1f
callq 0x2270
testq %rax, %rax
je 0xe079
movq %rax, %rbx
movl $0x30, %edi
callq 0x2230
movq %rax, %rdi
callq 0xe34f
movq %rax, %r14
leaq 0x7aca(%rip), %rax      # 0x15b08
movq %rax, (%r14)
movq %r15, %rdi
callq 0x22e0
movq %rax, %rdi
callq 0xe34f
movq %rax, 0x8(%r14)
movl $0x400, %edi            # imm = 0x400
callq 0x2230
movq %rax, %rdi
callq 0xe34f
movq %rax, 0x28(%r14)
movq %rbx, 0x20(%r14)
movl $0x0, 0x10(%r14)
jmp 0xe07c
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: stack_pop
void stack_pop(
    STACK *stack)
{
    STREAM         *top = stack->top;
    STREAM         *next = top->next;

    top->vtbl->delete(top);
    stack->top = next;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movq (%rdi), %rax
movq 0x18(%rdi), %r14
callq *(%rax)
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: stack_gets
char           *stack_gets(
    STACK *stack)
{
    char           *line;

    if (stack->top == NULL)
        return NULL;

    while ((line = stack->top->vtbl->gets(stack->top)) == NULL) {
        stack_pop(stack);
        if (stack->top == NULL)
            return NULL;
    }

    return line;
}

// Assembly:
cmpq $0x0, (%rdi)
je 0xe0ef
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rbx), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
testq %rax, %rax
jne 0xe0e7
movq (%rbx), %rdi
movq (%rdi), %rax
movq 0x18(%rdi), %r14
callq *(%rax)
movq %r14, (%rbx)
testq %r14, %r14
jne 0xe0c3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/stream2.c
// Function: file_gets
static char    *file_gets(
    STREAM *str)
{
    int             i,
                    c;
    FILE_STREAM    *fstr = (FILE_STREAM *) str;

    if (fstr->fp == NULL)
        return NULL;

    if (feof(fstr->fp))
        return NULL;

    /* Read single characters, end of line when '\n' or '\f' hit */

    i = 0;
    while (c = fgetc(fstr->fp), c != '\n' && c != '\f' && c != EOF) {
        if (c == 0)
            continue;                  /* Don't buffer zeros */
        if (c == '\r')
            continue;                  /* Don't buffer carriage returns either */
        if (i < STREAM_BUFFER_SIZE - 2)
            fstr->buffer[i++] = c;
    }

    fstr->buffer[i++] = '\n';          /* Silently transform formfeeds
                                          into newlines */
    fstr->buffer[i] = 0;

    if (c == '\n')
        fstr->stream.line++;           /* Count a line */

    return fstr->buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0xe150
callq 0x21f0
xorl %r14d, %r14d
testl %eax, %eax
jne 0xe175
movl $0x4002, %ebp           # imm = 0x4002
movl $0x2801, %r15d          # imm = 0x2801
movq 0x20(%rbx), %rdi
callq 0x2160
leal 0x1(%rax), %ecx
cmpl $0xe, %ecx
ja 0xe138
btl %ecx, %ebp
jb 0xe11c
btl %ecx, %r15d
jb 0xe155
cmpl $0x3fd, %r14d           # imm = 0x3FD
ja 0xe11c
movq 0x28(%rbx), %rcx
movl %r14d, %edx
incl %r14d
movb %al, (%rcx,%rdx)
jmp 0xe11c
xorl %r14d, %r14d
jmp 0xe175
movq 0x28(%rbx), %rcx
movl %r14d, %edx
movb $0xa, (%rcx,%rdx)
movq 0x28(%rbx), %rcx
movb $0x0, 0x1(%rcx,%rdx)
cmpl $0xa, %eax
jne 0xe171
incl 0x10(%rbx)
movq 0x28(%rbx), %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/util.c
// Function: my_ultoa
char           *my_ultoa(
    unsigned long val,
    char *buf,
    unsigned int base)
{
    static char     digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    char           *strt = buf,
            *end;

    do {
        *buf++ = digits[val % base];
        val /= base;
    } while (val != 0);

    *buf = 0;                          /* delimit */
    end = buf + 1;

    /* Now reverse the bytes */

    while (buf > strt) {
        char            temp;

        temp = *--buf;
        *buf = *strt;
        *strt++ = temp;
    }

    return end;
}

// Assembly:
movl %edx, %r8d
leaq 0x2aa2(%rip), %r9       # 0x10c30
movq %rsi, %rcx
movq %rdi, %rax
xorl %edx, %edx
divq %r8
movb (%rdx,%r9), %dl
movb %dl, (%rcx)
incq %rcx
cmpq %r8, %rdi
movq %rax, %rdi
jae 0xe191
movb $0x0, (%rcx)
cmpq %rsi, %rcx
jbe 0xe1d5
incq %rsi
movq %rcx, %rax
movb -0x1(%rax), %dl
movb -0x1(%rsi), %dil
movb %dil, -0x1(%rax)
decq %rax
movb %dl, -0x1(%rsi)
leaq 0x1(%rsi), %rdx
cmpq %rsi, %rax
movq %rdx, %rsi
ja 0xe1b8
incq %rcx
movq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/util.c
// Function: my_ltoa
char           *my_ltoa(
    long val,
    char *buf,
    unsigned int base)
{
    unsigned long   uval;

    if (val < 0)
        uval = -val, *buf++ = '-';
    else
        uval = val;

    return my_ultoa(uval, buf, base);
}

// Assembly:
testq %rdi, %rdi
jns 0xe1ea
negq %rdi
movb $0x2d, (%rsi)
incq %rsi
movl %edx, %r8d
leaq 0x2a3c(%rip), %r9       # 0x10c30
movq %rsi, %rcx
movq %rdi, %rax
xorl %edx, %edx
divq %r8
movb (%rdx,%r9), %dl
movb %dl, (%rcx)
incq %rcx
cmpq %r8, %rdi
movq %rax, %rdi
jae 0xe1f7
movb $0x0, (%rcx)
cmpq %rsi, %rcx
jbe 0xe23b
incq %rsi
movq %rcx, %rax
movb -0x1(%rax), %dl
movb -0x1(%rsi), %dil
movb %dil, -0x1(%rax)
decq %rax
movb %dl, -0x1(%rsi)
leaq 0x1(%rsi), %rdx
cmpq %rsi, %rax
movq %rdx, %rsi
ja 0xe21e
incq %rcx
movq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/util.c
// Function: my_searchenv
void my_searchenv(
    char *name,
    char *envname,
    char *hitfile,
    int hitlen)
{
    my_searchenv1(name, envname, hitfile, hitlen);
    if (*hitfile) {
        return;
    }

    char *copy = memcheck(strdup(name));
    downcase(copy);
    my_searchenv1(copy, envname, hitfile, hitlen);
    free(copy);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0xe2c8
cmpb $0x0, (%r14)
je 0xe269
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x22e0
movq %rax, %r12
movq %rax, %rdi
callq 0xe34f
movb (%r12), %bpl
testb %bpl, %bpl
je 0xe2a8
callq 0x22f0
movq %r12, %rcx
incq %rcx
movq (%rax), %rdx
movzbl %bpl, %esi
movb (%rdx,%rsi,4), %dl
movb %dl, -0x1(%rcx)
movb (%rcx), %bpl
incq %rcx
testb %bpl, %bpl
jne 0xe290
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0xe2c8
movq %r12, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/util.c
// Function: my_searchenv1
static void my_searchenv1(
    char *name,
    char *envname,
    char *hitfile,
    int hitlen)
{
    my_searchenv2(name, envname, hitfile, hitlen);
    if (*hitfile) {
        return;
    }

    /*
     * Parse DEV:[DIR]NAME
     * while re-trying the search after DEV: and after [DIR].
     *
     * Let's not be too critical about the characters we allow in those.
     */
    char *p = name;
    char c;

    while ((c = *p++)) {
        if (c == ':') {
            my_searchenv2(p, envname, hitfile, hitlen);
            if (*hitfile) {
                return;
            }
        }
        if (c == '[') {
            char *enddir = strchr(p, ']');
            if (enddir == NULL) {
                return; /* weird syntax */
            }
            p = enddir + 1;
            my_searchenv2(p, envname, hitfile, hitlen);
            return;
        }
    }

    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0xe40a
cmpb $0x0, (%r14)
je 0xe30b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0xe40a
cmpb $0x0, (%r14)
jne 0xe2e6
cmpb $0x5b, %bpl
je 0xe322
incq %r12
movzbl -0x1(%r12), %ebp
cmpl $0x3a, %ebp
je 0xe2ef
testl %ebp, %ebp
je 0xe2e6
cmpl $0x5b, %ebp
jne 0xe30b
movq %r12, %rdi
movl $0x5d, %esi
callq 0x20f0
testq %rax, %rax
je 0xe2e6
incq %rax
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xe40a
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/util.c
// Function: padto
void padto(
    char *str,
    int to)
{
    int             needspace = to - strlen(str);

    str += strlen(str);
    while (needspace > 0)
        *str++ = ' ', needspace--;
    *str = 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x20e0
movq %rax, %r14
movl %ebp, %eax
subl %r14d, %eax
addq %r14, %rbx
testl %eax, %eax
jle 0xe402
notl %r14d
addl %ebp, %r14d
leaq 0x1(%r14), %rdx
movq %rbx, %rdi
movl $0x20, %esi
callq 0x2140
addq %r14, %rbx
incq %rbx
movb $0x0, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/rad50.c
// Function: rad50
unsigned rad50(
    char *cp,
    char **endp)
{
    unsigned long   acc = 0;
    char           *rp;

    if (endp)
        *endp = cp;

    if (!*cp)                          /* Got to check for end-of-string manually, because strchr will call it a hit.  :-/ */
        return acc;

    rp = strchr(radtbl, toupper((unsigned char)*cp));
    if (rp == NULL)                    /* Not a RAD50 character */
        return acc;
    acc = ((int) (rp - radtbl)) * 03100;        /* Convert */
    cp++;

    /* Now, do the same thing two more times... */

    if (endp)
        *endp = cp;
    if (!*cp)
        return acc;
    rp = strchr(radtbl, toupper((unsigned char)*cp));
    if (rp == NULL)
        return acc;
    acc += ((int) (rp - radtbl)) * 050;

    cp++;
    if (endp)
        *endp = cp;
    if (!*cp)
        return acc;
    rp = strchr(radtbl, toupper((unsigned char)*cp));
    if (rp == NULL)
        return acc;
    acc += (int) (rp - radtbl);

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

    return acc;                        /* Done. */
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0xe567
movq %r14, (%rbx)
movzbl (%r14), %r13d
xorl %r15d, %r15d
testq %r13, %r13
je 0xe632
callq 0x2030
movq %rax, %r12
movq (%rax), %rax
movl (%rax,%r13,4), %esi
leaq 0x7593(%rip), %rdi      # 0x15b20
callq 0x20f0
testq %rax, %rax
je 0xe632
leaq 0x757e(%rip), %rcx      # 0x15b20
subl %ecx, %eax
leaq 0x1(%r14), %rcx
testq %rbx, %rbx
je 0xe5b0
movq %rcx, (%rbx)
imull $0x640, %eax, %r15d     # imm = 0x640
movzbl (%rcx), %eax
testq %rax, %rax
je 0xe632
movq (%r12), %rcx
movl (%rcx,%rax,4), %esi
leaq 0x7553(%rip), %rdi      # 0x15b20
callq 0x20f0
testq %rax, %rax
je 0xe632
leaq 0x7542(%rip), %rcx      # 0x15b20
subl %ecx, %eax
shll $0x3, %eax
leal (%rax,%rax,4), %r13d
leaq 0x2(%r14), %rax
testq %rbx, %rbx
je 0xe5f3
movq %rax, (%rbx)
addq %r15, %r13
movzbl (%rax), %eax
testq %rax, %rax
je 0xe62f
movq (%r12), %rcx
movl (%rcx,%rax,4), %esi
leaq 0x7514(%rip), %rdi      # 0x15b20
callq 0x20f0
testq %rax, %rax
je 0xe62f
testq %rbx, %rbx
je 0xe622
addq $0x3, %r14
movq %r14, (%rbx)
leaq 0x74f7(%rip), %rcx      # 0x15b20
subl %ecx, %r13d
addl %eax, %r13d
movl %r13d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/rad50.c
// Function: rad50x2
void rad50x2(
    char *cp,
    unsigned *rp)
{
    *rp++ = rad50(cp, &cp);
    *rp = 0;
    if (*cp)
        *rp = rad50(cp, &cp);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsp, %r14
movq %rdi, (%r14)
movq %r14, %rsi
callq 0xe550
movl %eax, (%rbx)
movl $0x0, 0x4(%rbx)
movq (%r14), %rdi
cmpb $0x0, (%rdi)
je 0xe670
movq %rsp, %rsi
callq 0xe550
movl %eax, 0x4(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/rad50.c
// Function: unrad50
void unrad50(
    unsigned word,
    char *cp)
{
    if (word < 0175000) {              /* Is it legal RAD50? */
        cp[0] = radtbl[word / 03100];
        cp[1] = radtbl[(word / 050) % 050];
        cp[2] = radtbl[word % 050];
    } else
        cp[0] = cp[1] = cp[2] = ' ';
}

// Assembly:
cmpl $0xf9ff, %edi           # imm = 0xF9FF
ja 0xe6d3
movl %edi, %eax
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
shrq $0x29, %rcx
leaq 0x748c(%rip), %rdx      # 0x15b20
movb (%rcx,%rdx), %cl
movb %cl, (%rsi)
movl $0xcccccccd, %ecx       # imm = 0xCCCCCCCD
imulq %rax, %rcx
shrq $0x25, %rcx
imulq $0x6666667, %rcx, %rax  # imm = 0x6666667
shrq $0x20, %rax
shll $0x3, %eax
leal (%rax,%rax,4), %eax
movl %ecx, %r8d
subl %eax, %r8d
movb (%r8,%rdx), %al
movb %al, 0x1(%rsi)
shll $0x3, %ecx
leal (%rcx,%rcx,4), %eax
subl %eax, %edi
movb (%rdi,%rdx), %al
movb %al, 0x2(%rsi)
retq
movb $0x20, 0x2(%rsi)
movw $0x2020, (%rsi)         # imm = 0x2020
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/rad50.c
// Function: ascii2rad50
int ascii2rad50(
    char c)
{
    char           *rp;

    if (c == '\0')                     /* Not a RAD50 character */
        return -1;
    rp = strchr(radtbl, toupper((unsigned char)c));
    if (rp == NULL)                    /* Not a RAD50 character */
        return -1;
    return (int) (rp - radtbl);        /* Convert */
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testb %bpl, %bpl
je 0xe717
callq 0x2030
movq (%rax), %rax
movzbl %bpl, %ecx
movl (%rax,%rcx,4), %esi
leaq 0x741e(%rip), %rdi      # 0x15b20
callq 0x20f0
testq %rax, %rax
je 0xe717
leaq 0x740d(%rip), %rcx      # 0x15b20
subl %ecx, %eax
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/rad50.c
// Function: packrad50word
unsigned packrad50word(
    char *cp,
    int len)
{
    unsigned long   acc = 0;

    if (len >= 1) {
        acc += (cp[0] % 050) * 050 * 050;
    }
    if (len >= 2) {
        acc += (cp[1] % 050) * 050;
    }
    if (len >= 3) {
        acc += cp[2] % 050;
    }

    return acc;
}

// Assembly:
testl %esi, %esi
jle 0xe74c
movsbq (%rdi), %rax
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x24, %rcx
addl %edx, %ecx
shll $0x3, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
imull $0x640, %eax, %eax      # imm = 0x640
jmp 0xe74e
xorl %eax, %eax
cmpl $0x2, %esi
jl 0xe77e
movsbq 0x1(%rdi), %rcx
imulq $0x66666667, %rcx, %rdx # imm = 0x66666667
movq %rdx, %r8
shrq $0x3f, %r8
sarq $0x24, %rdx
addl %r8d, %edx
shll $0x3, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
shll $0x3, %ecx
leal (%rcx,%rcx,4), %ecx
addq %rcx, %rax
cmpl $0x3, %esi
jl 0xe7a7
movsbq 0x2(%rdi), %rcx
imulq $0x66666667, %rcx, %rdx # imm = 0x66666667
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x24, %rdx
addl %esi, %edx
shll $0x3, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
addq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_ai_eq
int
af_ai_eq(const struct addrinfo *a1, const struct addrinfo *a2)
{

	return ((a1->ai_family == a2->ai_family) &&
	    (a1->ai_socktype == a2->ai_socktype) &&
	    (a1->ai_protocol == a2->ai_protocol) &&
	    af_sockaddr_eq(a1->ai_addr, a2->ai_addr));
}

// Assembly:
movl 0x4(%rdi), %eax
cmpl 0x4(%rsi), %eax
jne 0x2461
movl 0x8(%rdi), %eax
cmpl 0x8(%rsi), %eax
jne 0x2461
movl 0xc(%rdi), %eax
cmpl 0xc(%rsi), %eax
jne 0x2461
movq 0x18(%rdi), %rdi
movq 0x18(%rsi), %rsi
jmp 0x2464
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_sockaddr_eq
int
af_sockaddr_eq(const struct sockaddr *sa1, const struct sockaddr *sa2)
{
	int res;

	res = 0;

	if (sa1->sa_family == sa2->sa_family) {
		switch (sa1->sa_family) {
		case AF_INET:
			res = (((struct sockaddr_in *)sa1)->sin_addr.s_addr ==
			    ((struct sockaddr_in *)sa2)->sin_addr.s_addr);
			break;
		case AF_INET6:
			res = IN6_ARE_ADDR_EQUAL(
			    &((struct sockaddr_in6 *)sa1)->sin6_addr,
			    &((struct sockaddr_in6 *)sa2)->sin6_addr);
			break;
		default:
			err(1, "Unknown sockaddr family");
			break;
		}
	}

	return (res);
}

// Assembly:
movzwl (%rdi), %edx
xorl %eax, %eax
cmpw (%rsi), %dx
jne 0x24a5
movl $0x4, %ecx
cmpl $0x2, %edx
je 0x249a
cmpl $0xa, %edx
jne 0x24a6
movl 0x8(%rdi), %ecx
cmpl 0x8(%rsi), %ecx
jne 0x24a5
movl 0xc(%rdi), %ecx
cmpl 0xc(%rsi), %ecx
jne 0x24a5
movl 0x10(%rdi), %edx
movl $0x14, %ecx
cmpl 0x10(%rsi), %edx
jne 0x24a5
movl (%rdi,%rcx), %edx
xorl %eax, %eax
cmpl (%rsi,%rcx), %edx
sete %al
retq
pushq %rax
leaq 0x7c2f(%rip), %rsi      # 0xa0dd
movl $0x1, %edi
xorl %eax, %eax
callq 0x2230
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_ai_deep_eq
int
af_ai_deep_eq(const struct addrinfo *a1, const struct addrinfo *a2)
{
	const struct addrinfo *a1_i, *a2_i;

	for (a1_i = a1; a1_i != NULL; a1_i = a1_i->ai_next) {
		for (a2_i = a2; a2_i != NULL; a2_i = a2_i->ai_next) {
			if (af_ai_eq(a1_i, a2_i)) {
				return (1);
			}
		}
	}

	return (0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x2500
movq %rsi, %r14
movq %rdi, %r15
testq %r14, %r14
je 0x24f0
movq %r14, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x243c
testl %eax, %eax
jne 0x24fb
movq 0x28(%r12), %r12
testq %r12, %r12
jne 0x24d7
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0x24cf
jmp 0x2500
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_ai_is_loopback
int
af_ai_is_loopback(const struct addrinfo *ai)
{
	int res;

	switch (ai->ai_family) {
	case PF_INET:
		res = ntohl(((struct sockaddr_in *)(ai->ai_addr))->sin_addr.s_addr) >> 24 == 0x7f;
		break;
	case PF_INET6:
		res = IN6_IS_ADDR_LOOPBACK(&((struct sockaddr_in6 *)(ai->ai_addr))->sin6_addr);
		break;
	default:
		DEBUG_PRINTF("Unknown ai family %d", ai->ai_family);
		errx(1, "Unknown ai family %d", ai->ai_family);
	}

	return (res);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %r8d
cmpl $0xa, %r8d
je 0x2566
cmpl $0x2, %r8d
jne 0x2592
movq 0x18(%rbx), %rax
cmpb $0x7f, 0x4(%rax)
sete %al
jmp 0x257e
movq 0x18(%rbx), %rax
cmpl $0x0, 0x8(%rax)
jne 0x257c
cmpl $0x0, 0xc(%rax)
jne 0x257c
cmpl $0x0, 0x10(%rax)
je 0x2589
xorl %eax, %eax
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x1000000, 0x14(%rax)  # imm = 0x1000000
jmp 0x2561
leaq 0x7a87(%rip), %rdi      # 0xa020
leaq 0x7aba(%rip), %r14      # 0xa05a
movl $0xbc, %esi
movl $0x2, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x4ada
movl 0x4(%rbx), %edx
movl $0x1, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_is_sa_mcast
int
af_is_sa_mcast(const struct sockaddr *addr)
{

	switch (addr->sa_family) {
	case AF_INET:
		return IN_MULTICAST(ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr));
		break;
	case AF_INET6:
		return IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6 *)addr)->sin6_addr);
		break;
	default:
		DEBUG_PRINTF("Unknown sockaddr family");
                errx(1, "Unknown sockaddr family");
		break;
	}

	return (0);
}

// Assembly:
movzwl (%rdi), %eax
cmpl $0xa, %eax
je 0x2617
cmpl $0x2, %eax
jne 0x2622
movl $0xf0, %eax
andl 0x4(%rdi), %eax
cmpl $0xe0, %eax
jmp 0x261b
cmpb $-0x1, 0x8(%rdi)
sete %al
movzbl %al, %eax
retq
pushq %rbx
leaq 0x79f6(%rip), %rdi      # 0xa020
leaq 0x7aac(%rip), %rbx      # 0xa0dd
movl $0x171, %esi            # imm = 0x171
movl $0x2, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4ada
movl $0x1, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_ai_deep_supported_ipv
int
af_ai_deep_supported_ipv(const struct addrinfo *ai_addr)
{
	const struct addrinfo *ai_iter;
	int ip4, ip6;

	ip4 = 0;
	ip6 = 0;

	for (ai_iter = ai_addr; ai_iter != NULL; ai_iter = ai_iter->ai_next) {
		switch (af_ai_supported_ipv(ai_iter)) {
		case 4:
			ip4 = 1;
			break;
		case 6:
			ip6 = 1;
			break;
		case 0:
			DEBUG_PRINTF("internal program error.");
			err(1, "Internal program error");
			break;
		}
	}

	if (ip4 && ip6)
		return (0);
	if (ip6)
		return (6);
	if (ip4)
		return (4);

	return (-1);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x26b7
xorl %eax, %eax
movl $0x6, %ecx
movl $0x4, %edx
leaq 0x7997(%rip), %rsi      # 0xa004
xorl %r8d, %r8d
movl 0x4(%rdi), %r9d
cmpl $0xa, %r9d
movl $0x0, %r10d
cmovel %ecx, %r10d
cmpl $0x2, %r9d
cmovel %edx, %r10d
movslq (%rsi,%r10,4), %r9
addq %rsi, %r9
jmpq *%r9
movl $0x1, %r8d
jmp 0x26a1
movl $0x1, %eax
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
jne 0x2670
testl %r8d, %r8d
sete %dl
testl %eax, %eax
sete %cl
jmp 0x26bb
movb $0x1, %dl
movb $0x1, %cl
movzbl %dl, %eax
movl %eax, %edx
negl %edx
orl $0x4, %edx
xorl %esi, %esi
testb %al, %al
movl $0x6, %eax
cmovel %esi, %eax
testb %cl, %cl
cmovnel %edx, %eax
popq %rcx
retq
leaq 0x7941(%rip), %rdi      # 0xa020
leaq 0x7945(%rip), %rcx      # 0xa02b
movl $0x84, %esi
movl $0x2, %edx
xorl %eax, %eax
callq 0x4ada
leaq 0x7945(%rip), %rsi      # 0xa043
movl $0x1, %edi
xorl %eax, %eax
callq 0x2230
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_ai_is_dup
int
af_ai_is_dup(const struct addrinfo *ai_list, const struct addrinfo *ai)
{
	const struct addrinfo *ai_i;
	int res;

	res = 0;

	for (ai_i = ai_list; res == 0 && ai_i != ai && ai_i != NULL; ai_i = ai_i->ai_next) {
		if (af_ai_eq(ai_i, ai)) {
			res = 1;
		}
	}

	return (res);
}

// Assembly:
cmpq %rsi, %rdi
sete %cl
testq %rdi, %rdi
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x2766
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x243c
testl %eax, %eax
jne 0x275f
movq 0x28(%r14), %r14
cmpq %rbx, %r14
je 0x275f
testq %r14, %r14
jne 0x2742
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_copy_addr
int
af_copy_addr(const struct sockaddr_storage *a1, const struct sockaddr_storage *a2, int addr_source,
    int port_source, struct sockaddr_storage *res)
{
	const struct sockaddr_storage *sas;

	if (addr_source != 1 && addr_source != 2) {
		return (-1);
	}

	if (port_source != 1 && port_source != 2) {
		return (-1);
	}

	sas = (addr_source == 1 ? a1 : a2);
	memcpy(res, sas, sizeof(struct sockaddr_storage));

	if (addr_source == port_source) {
		return (0);
	}

	sas = (port_source == 1 ? a1 : a2);

	switch (sas->ss_family) {
	case AF_INET:
		((struct sockaddr_in *)res)->sin_port = ((struct sockaddr_in *)sas)->sin_port;
		break;
	case AF_INET6:
		((struct sockaddr_in6 *)res)->sin6_port = ((struct sockaddr_in6 *)sas)->sin6_port;
		break;
	default:
		DEBUG_PRINTF("Unknown sas family %d", sas->ss_family);
		errx(1, "Unknown sas family %d", sas->ss_family);

	}

	return (0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r10d
leal -0x3(%rdx), %eax
cmpl $-0x2, %eax
setb %al
leal -0x3(%r10), %ecx
cmpl $-0x2, %ecx
setb %cl
orb %al, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x27c9
movq %rsi, %rbx
movq %rdi, %r9
cmpl $0x1, %edx
cmoveq %rdi, %rsi
movl $0x10, %ecx
movq %r8, %rdi
rep  movsq (%rsi), %es:(%rdi)
xorl %eax, %eax
cmpl %r10d, %edx
je 0x27c9
cmpl $0x1, %r10d
cmoveq %r9, %rbx
movzwl (%rbx), %r9d
movl %r9d, %ecx
orl $0x8, %ecx
cmpl $0xa, %ecx
jne 0x27d1
movzwl 0x2(%rbx), %ecx
movw %cx, 0x2(%r8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7848(%rip), %rdi      # 0xa020
leaq 0x7890(%rip), %r14      # 0xa06f
movl $0xff, %esi
movl $0x2, %edx
movq %r14, %rcx
movl %r9d, %r8d
xorl %eax, %eax
callq 0x4ada
movzwl (%rbx), %edx
movl $0x1, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_sa_len
socklen_t
af_sa_len(const struct sockaddr *sa)
{
	socklen_t res;

	switch (sa->sa_family) {
	case AF_INET:
		res = sizeof(struct sockaddr_in);
		break;
	case AF_INET6:
		res = sizeof(struct sockaddr_in6);
		break;
	default:
		DEBUG_PRINTF("Internal program error");
		errx(1,"Internal program error");
		break;
	}

	return (res);
}

// Assembly:
movzwl (%rdi), %ecx
movl $0x10, %eax
cmpl $0x2, %ecx
je 0x284b
cmpl $0xa, %ecx
jne 0x284c
movl $0x1c, %eax
retq
pushq %rbx
leaq 0x77cc(%rip), %rdi      # 0xa020
leaq 0x77e8(%rip), %rbx      # 0xa043
movl $0x1ca, %esi            # imm = 0x1CA
movl $0x2, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4ada
movl $0x1, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_create_any_addr
void
af_create_any_addr(struct sockaddr *sa, int sa_family, uint16_t port)
{
	struct sockaddr_in sa_in;
	struct sockaddr_in6 sa_in6;

	switch (sa_family) {
	case PF_INET:
		memset(&sa_in, 0, sizeof(sa_in));
		sa_in.sin_family = sa_family;
		sa_in.sin_port = htons(port);
		sa_in.sin_addr.s_addr = INADDR_ANY;
		memcpy(sa, &sa_in, sizeof(sa_in));
		break;
	case PF_INET6:
		memset(&sa_in6, 0, sizeof(sa_in6));
		sa_in6.sin6_family = sa_family;
		sa_in6.sin6_port = htons(port);
		sa_in6.sin6_addr = in6addr_any;
		memcpy(sa, &sa_in6, sizeof(sa_in6));
		break;
	default:
		DEBUG_PRINTF("Unknown ai family %d", sa_family);
		errx(1, "Unknown ai family %d", sa_family);
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
cmpl $0xa, %esi
je 0x28af
movl %esi, %ebx
cmpl $0x2, %esi
jne 0x28f2
rolw $0x8, %dx
movw $0x2, (%rdi)
movw %dx, 0x2(%rdi)
movl $0x0, 0x4(%rdi)
movq $0x0, 0x8(%rdi)
jmp 0x28ea
xorl %eax, %eax
movl %eax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
rolw $0x8, %dx
movq 0xc701(%rip), %rcx      # 0xefc8
movups (%rcx), %xmm0
movups %xmm0, 0x4(%rsp)
movw $0xa, (%rdi)
movw %dx, 0x2(%rdi)
movaps (%rsp), %xmm0
movups %xmm0, 0x4(%rdi)
movl 0x10(%rsp), %ecx
movl %ecx, 0x14(%rdi)
movl %eax, 0x18(%rdi)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x7727(%rip), %rdi      # 0xa020
leaq 0x775a(%rip), %r14      # 0xa05a
movl $0x12c, %esi            # imm = 0x12C
movl $0x2, %edx
movq %r14, %rcx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x4ada
movl $0x1, %edi
movq %r14, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_host_to_ai
struct addrinfo *
af_host_to_ai(const char *host_name, const char *port, int ip_ver)
{
	struct addrinfo ai_hints, *ai_res0, *ai_i;
	int error;
	char ai_s[LOGGING_SA_TO_STR_LEN];

	memset(&ai_hints, 0, sizeof(ai_hints));
	switch (ip_ver) {
	case 0:
		ai_hints.ai_family = PF_UNSPEC;
		break;
	case 4:
		ai_hints.ai_family = PF_INET;
		break;
	case 6:
		ai_hints.ai_family = PF_INET6;
		break;
	default:
		errx(1, "Unknown PF Family");
		/* NOTREACHED */
	}

	ai_hints.ai_socktype = SOCK_DGRAM;
	ai_hints.ai_protocol = IPPROTO_UDP;
	ai_hints.ai_flags = AI_PASSIVE;

	DEBUG_PRINTF("getaddrinfo for \"%s\" port %s ip_ver %d", host_name,
	    port, ip_ver);
	error = getaddrinfo(host_name, port, &ai_hints, &ai_res0);
	if (error != 0) {
		errx(1, "Can't get addr info for %s: %s", host_name, gai_strerror(error));
	}

	if (logging_get_verbose() >= LOGGING_LEVEL_DEBUG2) {
		for (ai_i = ai_res0; ai_i != NULL; ai_i = ai_i->ai_next) {
			logging_ai_to_str(ai_i, ai_s, sizeof(ai_s));
			DEBUG2_PRINTF("%s", ai_s);
		}
	}

	return (ai_res0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movl %edx, %eax
testl %edx, %edx
je 0x296e
cmpl $0x6, %edx
je 0x2969
cmpl $0x4, %edx
jne 0x2a5f
movl $0x2, %eax
jmp 0x296e
movl $0xa, %eax
leaq 0x10(%rsp), %r15
movl %eax, 0x4(%r15)
movabsq $0x1100000002, %rax     # imm = 0x1100000002
movq %rax, 0x8(%r15)
movl $0x1, (%r15)
movl %edx, (%rsp)
leaq 0x768a(%rip), %rdi      # 0xa020
leaq 0x76fa(%rip), %rcx      # 0xa097
movl $0x151, %esi            # imm = 0x151
movl $0x2, %edx
movq %rbx, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x4ada
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x22f0
testl %eax, %eax
jne 0x2a3f
callq 0x4a07
cmpl $0x3, %eax
setl %al
movq 0x8(%rsp), %rbx
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x2a2b
leaq 0x40(%rsp), %r14
leaq 0x762f(%rip), %r15      # 0xa020
leaq 0x7cf6(%rip), %r12      # 0xa6ee
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3e, %edx
callq 0x4994
movq %r15, %rdi
movl $0x15a, %esi            # imm = 0x15A
movl $0x3, %edx
movq %r12, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x4ada
movq 0x28(%rbx), %rbx
testq %rbx, %rbx
jne 0x29f8
movq 0x8(%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x2130
leaq 0x7671(%rip), %rsi      # 0xa0be
movl $0x1, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x20f0
leaq 0x761f(%rip), %rsi      # 0xa085
movl $0x1, %edi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/addrfunc.c
// Function: af_sa_to_any_addr
void
af_sa_to_any_addr(struct sockaddr *dest, const struct sockaddr *src)
{
	uint16_t port;

	switch (src->sa_family) {
	case PF_INET:
		port = ntohs(((struct sockaddr_in *)src)->sin_port);
		break;
	case PF_INET6:
		port = ntohs(((struct sockaddr_in6 *)src)->sin6_port);
		break;
	default:
		DEBUG_PRINTF("Unknown ai family %d", src->sa_family);
		errx(1, "Unknown ai family %d", src->sa_family);
	}

	af_create_any_addr(dest, src->sa_family, port);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movzwl (%rsi), %r8d
movl %r8d, %eax
orl $0x8, %eax
cmpl $0xa, %eax
jne 0x2cd4
movzwl 0x2(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %edx
movl %r8d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x287e
leaq 0x7345(%rip), %rdi      # 0xa020
leaq 0x7378(%rip), %r14      # 0xa05a
movl $0x226, %esi            # imm = 0x226
movl $0x2, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x4ada
movzwl (%rbx), %edx
movl $0x1, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/aiifunc.c
// Function: aii_list_free
void
aii_list_free(struct aii_list *aii_list)
{
	struct ai_item *ai_item;
	struct ai_item *ai_item_next;

	ai_item = TAILQ_FIRST(aii_list);

	while (ai_item != NULL) {
		ai_item_next = TAILQ_NEXT(ai_item, entries);

		free(ai_item->host_name);
		free(ai_item);

		ai_item = ai_item_next;
	}

	TAILQ_INIT(aii_list);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x2d83
movq 0x80(%r14), %rdi
movq 0x88(%r14), %r15
callq 0x2040
movq %r14, %rdi
callq 0x2040
movq %r15, %r14
testq %r15, %r15
jne 0x2d60
movq $0x0, (%rbx)
movq %rbx, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/aiifunc.c
// Function: aii_list_ai_to_sa
void
aii_list_ai_to_sa(struct aii_list *aii_list, int ip_ver)
{
	struct sockaddr_storage tmp_sas;
	struct addrinfo *ai_i;
	struct ai_item *ai_item_i;
	char *hn;

	TAILQ_FOREACH(ai_item_i, aii_list, entries) {
		hn = (char *)malloc(strlen(ai_item_i->host_name) + 1);
		if (hn == NULL) {
			errx(1, "Can't alloc memory");
		}

		memcpy(hn, ai_item_i->host_name, strlen(ai_item_i->host_name) + 1);
		ai_item_i->host_name = hn;

		for (ai_i = ai_item_i->ai; ai_i != NULL; ai_i = ai_i->ai_next) {
			if (af_ai_supported_ipv(ai_i) == ip_ver) {
				memset(&tmp_sas, 0, sizeof(tmp_sas));

				memcpy(&tmp_sas, ai_i->ai_addr, ai_i->ai_addrlen);

				freeaddrinfo(ai_item_i->ai);

				memcpy(&ai_item_i->sas, &tmp_sas, sizeof(tmp_sas));
				break;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq (%rdi), %r14
testq %r14, %r14
je 0x2e71
movl %esi, %ebx
movq %rsp, %r15
movq 0x80(%r14), %r12
movq %r12, %rdi
callq 0x20e0
movq %rax, %r13
incq %r13
movq %r13, %rdi
callq 0x2240
testq %rax, %rax
je 0x2e83
movq %rax, %rbp
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x21f0
movq %rbp, 0x80(%r14)
movq (%r14), %r12
testq %r12, %r12
je 0x2e61
movq %r12, %rdi
callq 0x270a
cmpl %ebx, %eax
je 0x2e0f
movq 0x28(%r12), %r12
jmp 0x2df7
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq 0x18(%r12), %rsi
movl 0x10(%r12), %edx
movq %r15, %rdi
callq 0x21f0
movq (%r14), %rdi
callq 0x2320
movl $0x10, %ecx
movq %r14, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x88(%r14), %r14
testq %r14, %r14
jne 0x2db6
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7366(%rip), %rsi      # 0xa1f0
movl $0x1, %edi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/aiifunc.c
// Function: aii_ifa_local_to_ai
void
aii_ifa_local_to_ai(struct aii_list *aii_list, struct ai_item *ai_local,
    const struct ifaddrs *ifa_local, int ip_ver, struct ai_item *local_addr, int *single_addr)
{
	size_t addr_len;
	uint16_t port;

	switch (ifa_local->ifa_addr->sa_family) {
	case AF_INET:
		addr_len = sizeof(struct sockaddr_in);
		port = ((struct sockaddr_in *)&ai_local->sas)->sin_port;
		break;
	case AF_INET6:
		addr_len = sizeof(struct sockaddr_in6);
		port = ((struct sockaddr_in6 *)&ai_local->sas)->sin6_port;
		break;
	default:
		DEBUG_PRINTF("Internal program error");
		err(1, "Internal program error");
		break;
	}

	memcpy(&local_addr->sas, ifa_local->ifa_addr, addr_len);
	local_addr->host_name = strdup(ai_local->host_name);
	if (local_addr->host_name == NULL) {
		err(1, "Can't alloc memory");
		/* NOTREACHED */
	}

	switch (ifa_local->ifa_addr->sa_family) {
	case AF_INET:
		((struct sockaddr_in *)&local_addr->sas)->sin_port = port;
		break;
	case AF_INET6:
		((struct sockaddr_in6 *)&local_addr->sas)->sin6_port = port;
		break;
	default:
		DEBUG_PRINTF("Internal program error");
		err(1, "Internal program error");
		break;
	}

	*single_addr = (TAILQ_NEXT(TAILQ_FIRST(aii_list), entries) == NULL);

	if (!*single_addr) {
		TAILQ_REMOVE(aii_list, ai_local, entries);

		free(ai_local->host_name);
		free(ai_local);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %r12
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdx), %rsi
movzwl (%rsi), %eax
movl $0x10, %edx
cmpl $0x2, %eax
je 0x317c
cmpl $0xa, %eax
jne 0x323f
movl $0x1c, %edx
movzwl 0x2(%rbx), %ebp
movq %r12, %rdi
callq 0x21f0
movq 0x80(%rbx), %rdi
callq 0x2310
movq %rax, 0x80(%r12)
testq %rax, %rax
je 0x3231
movq 0x18(%r13), %rax
movzwl (%rax), %eax
orl $0x8, %eax
cmpl $0xa, %eax
jne 0x3254
movw %bp, 0x2(%r12)
movq (%r14), %rax
xorl %ecx, %ecx
cmpq $0x0, 0x88(%rax)
sete %cl
movl %ecx, (%r15)
je 0x3222
movq 0x88(%rbx), %rax
movq 0x90(%rbx), %rcx
addq $0x8, %r14
leaq 0x90(%rax), %rdx
testq %rax, %rax
cmoveq %r14, %rdx
movq %rcx, (%rdx)
movq 0x90(%rbx), %rcx
movq %rax, (%rcx)
movq 0x80(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6fb8(%rip), %rsi      # 0xa1f0
movl $0x1, %edi
jmp 0x327e
leaq 0x6fc8(%rip), %rdi      # 0xa20e
leaq 0x6df6(%rip), %rbx      # 0xa043
movl $0xda, %esi
jmp 0x3267
leaq 0x6fb3(%rip), %rdi      # 0xa20e
leaq 0x6de1(%rip), %rbx      # 0xa043
movl $0xee, %esi
movl $0x2, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4ada
movl $0x1, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2230