LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_global_displaced_offset_word
int text_global_displaced_offset_word(
    TEXT_RLD *tr,
    unsigned *addr,
    int size,
    unsigned word,
    char *global)
{
    unsigned        radtbl[2];

    if (word == 0)
        return text_global_displaced_word(tr, addr, size, word, global);

    if (!text_fit(tr, *addr, size, 8))
        return 0;

    text_word_i(tr, word, size);
    rld_code(tr, RLD_GLOBAL_OFFSET_DISP, *addr, size);

    rad50x2(global, radtbl);
    rld_word(tr, radtbl[0]);
    rld_word(tr, radtbl[1]);
    rld_word(tr, word);

    *addr += size;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
testl %ecx, %ecx
je 0xc035
movl %ecx, %ebp
movl (%r14), %esi
pushq $0x8
popq %rcx
movq %r15, %rdi
movl %ebx, %edx
callq 0xbc5d
testl %eax, %eax
je 0xc055
movq %r15, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xbcc1
movl (%r14), %edx
pushq $0x6
popq %rsi
movq %r15, %rdi
movl %ebx, %ecx
callq 0xbd4f
movq %rsp, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xd008
movl (%r13), %esi
movq %r15, %rdi
callq 0xbd6f
movl 0x4(%r13), %esi
movq %r15, %rdi
callq 0xbd6f
movq %r15, %rdi
movl %ebp, %esi
callq 0xbd6f
addl %ebx, (%r14)
pushq $0x1
popq %rax
jmp 0xc057
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
movq %r12, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbe7b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_define_location
int text_define_location(
    TEXT_RLD *tr,
    char *name,
    unsigned *addr)
{
    unsigned        radtbl[2];

    if (!text_fit(tr, *addr, 0, 8))    /* No text space used */
        return 0;

    rld_code_naddr(tr, RLD_LOCDEF, 2); /* RLD code for "location
                                          counter def" with no offset */

    rad50x2(name, radtbl);
    rld_word(tr, radtbl[0]);           /* Set current section name */
    rld_word(tr, radtbl[1]);
    rld_word(tr, *addr);               /* Set current location addr */

    if (!text_flush(tr))               /* Flush that block out. */
        return 0;

    text_init(tr, tr->fp, *addr);      /* Set new text address */

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl (%rdx), %esi
xorl %ebp, %ebp
pushq $0x8
popq %rcx
xorl %edx, %edx
callq 0xbc5d
testl %eax, %eax
je 0xc112
movslq 0x110(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x110(%rbx)
movb $0x7, 0x90(%rbx,%rax)
movslq 0x110(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x110(%rbx)
movb $0x0, 0x90(%rbx,%rax)
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xd008
movl (%r12), %esi
movq %rbx, %rdi
callq 0xbd6f
movl 0x4(%r12), %esi
movq %rbx, %rdi
callq 0xbd6f
movl (%r14), %esi
movq %rbx, %rdi
callq 0xbd6f
movq %rbx, %rdi
callq 0xbbd3
testl %eax, %eax
je 0xc112
movq (%rbx), %rsi
movl (%r14), %edx
movq %rbx, %rdi
callq 0xbba0
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_modify_location
int text_modify_location(
    TEXT_RLD *tr,
    unsigned *addr)
{
    if (!text_fit(tr, *addr, 0, 4))    /* No text space used */
        return 0;

    rld_code_naddr(tr, RLD_LOCMOD, 2); /* RLD code for "location
                                          counter mod" with no offset */
    rld_word(tr, *addr);               /* Set current location addr */

    if (!text_flush(tr))               /* Flush that block out. */
        return 0;
    text_init(tr, tr->fp, *addr);      /* Set new text address */

    return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %esi
xorl %ebp, %ebp
pushq $0x4
popq %rcx
xorl %edx, %edx
callq 0xbc5d
testl %eax, %eax
je 0xc195
movslq 0x110(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x110(%rbx)
movb $0x8, 0x90(%rbx,%rax)
movslq 0x110(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x110(%rbx)
movb $0x0, 0x90(%rbx,%rax)
movl (%r14), %esi
movq %rbx, %rdi
callq 0xbd6f
movq %rbx, %rdi
callq 0xbbd3
testl %eax, %eax
je 0xc195
movq (%rbx), %rsi
movl (%r14), %edx
movq %rbx, %rdi
callq 0xbba0
pushq $0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_limits
int text_limits(
    TEXT_RLD *tr,
    unsigned *addr)
{
    if (!text_fit(tr, *addr, 4, 2))
        return 0;

    text_word_i(tr, 0, 2);
    text_word_i(tr, 0, 2);
    rld_code(tr, RLD_LIMITS, *addr, 2);

    *addr += 4;

    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %esi
pushq $0x4
popq %rdx
pushq $0x2
popq %rcx
callq 0xbc5d
testl %eax, %eax
je 0xc229
movslq 0x8c(%r14), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x8c(%r14)
xorl %ecx, %ecx
movb %cl, 0x8(%r14,%rax)
movslq 0x8c(%r14), %rax
leal 0x1(%rax), %edx
movl %edx, 0x8c(%r14)
movb %cl, 0x8(%r14,%rax)
movslq 0x8c(%r14), %rax
leal 0x1(%rax), %edx
movl %edx, 0x8c(%r14)
movb %cl, 0x8(%r14,%rax)
movslq 0x8c(%r14), %rax
leal 0x1(%rax), %edx
movl %edx, 0x8c(%r14)
movb %cl, 0x8(%r14,%rax)
movl (%rbx), %edx
pushq $0x9
popq %rsi
pushq $0x2
popq %rcx
movq %r14, %rdi
callq 0xbd4f
addl $0x4, (%rbx)
pushq $0x1
popq %rax
jmp 0xc22b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_psect_word
int text_psect_word(
    TEXT_RLD *tr,
    unsigned *addr,
    int size,
    unsigned word,
    char *name)
{
    unsigned        radtbl[2];

    if (!text_fit(tr, *addr, size, 6))
        return 0;

    text_word_i(tr, word, size);

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

    rad50x2(name, radtbl);
    rld_word(tr, radtbl[0]);
    rld_word(tr, radtbl[1]);

    *addr += size;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl (%rsi), %esi
pushq $0x6
popq %rcx
callq 0xbc5d
testl %eax, %eax
je 0xc2a3
movq %r15, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xbcc1
movl (%r14), %edx
pushq $0xa
popq %rsi
movq %r15, %rdi
movl %ebx, %ecx
callq 0xbd4f
movq %rsp, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xd008
movl (%r13), %esi
movq %r15, %rdi
callq 0xbd6f
movl 0x4(%r13), %esi
movq %r15, %rdi
callq 0xbd6f
addl %ebx, (%r14)
pushq $0x1
popq %rax
jmp 0xc2a5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_psect_offset_word
int text_psect_offset_word(
    TEXT_RLD *tr,
    unsigned *addr,
    int size,
    unsigned word,
    char *name)
{
    unsigned        radtbl[2];

#if OPTIMIZE_ZERO_OFFSET
    if (word == 0)
        return text_psect_word(tr, addr, size, word, name);
#endif

    if (!text_fit(tr, *addr, size, 8))
        return 0;

    text_word_i(tr, word, size);

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

    rad50x2(name, radtbl);
    rld_word(tr, radtbl[0]);
    rld_word(tr, radtbl[1]);
    rld_word(tr, word);

    *addr += size;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl (%rsi), %esi
pushq $0x8
popq %rcx
callq 0xbc5d
testl %eax, %eax
je 0xc32e
movq %r15, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xbcc1
movl (%r14), %edx
pushq $0xd
popq %rsi
movq %r15, %rdi
movl %ebx, %ecx
callq 0xbd4f
movq %rsp, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xd008
movl (%r13), %esi
movq %r15, %rdi
callq 0xbd6f
movl 0x4(%r13), %esi
movq %r15, %rdi
callq 0xbd6f
movq %r15, %rdi
movl %ebp, %esi
callq 0xbd6f
addl %ebx, (%r14)
pushq $0x1
popq %rax
jmp 0xc330
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_psect_displaced_word
int text_psect_displaced_word(
    TEXT_RLD *tr,
    unsigned *addr,
    int size,
    unsigned word,
    char *name)
{
    unsigned        radtbl[2];

    if (!text_fit(tr, *addr, size, 6))
        return 0;

    text_word_i(tr, word, size);

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

    rad50x2(name, radtbl);
    rld_word(tr, radtbl[0]);
    rld_word(tr, radtbl[1]);

    *addr += size;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl (%rsi), %esi
pushq $0x6
popq %rcx
callq 0xbc5d
testl %eax, %eax
je 0xc3af
movq %r15, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xbcc1
movl (%r14), %edx
pushq $0xc
popq %rsi
movq %r15, %rdi
movl %ebx, %ecx
callq 0xbd4f
movq %rsp, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xd008
movl (%r13), %esi
movq %r15, %rdi
callq 0xbd6f
movl 0x4(%r13), %esi
movq %r15, %rdi
callq 0xbd6f
addl %ebx, (%r14)
pushq $0x1
popq %rax
jmp 0xc3b1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_psect_displaced_offset_word
int text_psect_displaced_offset_word(
    TEXT_RLD *tr,
    unsigned *addr,
    int size,
    unsigned word,
    char *name)
{
    unsigned        radtbl[2];

#if OPTIMIZE_ZERO_OFFSET
    if (word == 0)
        return text_psect_displaced_word(tr, addr, size, word, name);
#endif

    if (!text_fit(tr, *addr, size, 8))
        return 0;

    text_word_i(tr, word, size);

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

    rad50x2(name, radtbl);
    rld_word(tr, radtbl[0]);
    rld_word(tr, radtbl[1]);
    rld_word(tr, word);

    *addr += size;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl (%rsi), %esi
pushq $0x8
popq %rcx
callq 0xbc5d
testl %eax, %eax
je 0xc43a
movq %r15, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xbcc1
movl (%r14), %edx
pushq $0xe
popq %rsi
movq %r15, %rdi
movl %ebx, %ecx
callq 0xbd4f
movq %rsp, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xd008
movl (%r13), %esi
movq %r15, %rdi
callq 0xbd6f
movl 0x4(%r13), %esi
movq %r15, %rdi
callq 0xbd6f
movq %r15, %rdi
movl %ebp, %esi
callq 0xbd6f
addl %ebx, (%r14)
pushq $0x1
popq %rax
jmp 0xc43c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro11/object.c
// Function: text_complex_lit
int text_complex_lit(
    TEXT_COMPLEX *tx,
    unsigned word)
{
    char           *cp = text_complex_fit(tx, 3);

    if (!cp)
        return 0;
    *cp++ = CPLX_CONST;
    *cp++ = word & 0xff;
    *cp = (word >> 8) & 0xff;
    return 1;
}

// Assembly:
movslq 0x80(%rdi), %rdx
xorl %eax, %eax
cmpq $0x7b, %rdx
jg 0xc59c
movl %esi, %ecx
leal 0x3(%rdx), %eax
movl %eax, 0x80(%rdi)
movb $0x10, (%rdi,%rdx)
movb %cl, 0x1(%rdi,%rdx)
movb %ch, 0x2(%rdi,%rdx)
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movslq 0x80(%rdi), %r15
xorl %eax, %eax
cmpq $0x79, %r15
jg 0xc5ef
movq %rdi, %rbx
leal 0x5(%r15), %eax
movl %eax, 0x80(%rdi)
leaq 0x8(%rsp), %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0xd008
movb $0xe, (%rbx,%r15)
movzwl (%r14), %eax
movw %ax, 0x1(%rbx,%r15)
movzwl 0x4(%r14), %eax
movw %ax, 0x3(%rbx,%r15)
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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, %ebp
movq %rcx, %r15
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r12
movslq 0x80(%rcx), %rcx
cmpq $0x7d, %rcx
jg 0xc65f
leal 0x1(%rcx), %eax
movl %eax, 0x80(%r15)
movb $0xa, (%r15,%rcx)
movl 0x80(%r15), %ecx
movl (%r14), %esi
addl $0x2, %ecx
movq %r12, %rdi
movl %ebx, %edx
callq 0xbc5d
testl %eax, %eax
je 0xc6c9
movl (%r14), %edx
pushq $0xf
popq %rsi
movq %r12, %rdi
movl %ebx, %ecx
callq 0xbd4f
xorl %eax, %eax
movslq 0x80(%r15), %rcx
cmpq %rcx, %rax
jge 0xc6b5
movb (%r15,%rax), %cl
movslq 0x110(%r12), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x110(%r12)
movb %cl, 0x90(%r12,%rdx)
incq %rax
jmp 0xc685
movq %r12, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xbcc1
addl %ebx, (%r14)
pushq $0x1
popq %rax
jmp 0xc6cb
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %ebp
movq %rcx, %r15
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r12
movslq 0x80(%rcx), %rcx
cmpq $0x7d, %rcx
jg 0xc70d
leal 0x1(%rcx), %eax
movl %eax, 0x80(%r15)
movb $0xb, (%r15,%rcx)
movl 0x80(%r15), %ecx
movl (%r14), %esi
addl $0x2, %ecx
movq %r12, %rdi
movl %ebx, %edx
callq 0xbc5d
testl %eax, %eax
je 0xc777
movl (%r14), %edx
pushq $0xf
popq %rsi
movq %r12, %rdi
movl %ebx, %ecx
callq 0xbd4f
xorl %eax, %eax
movslq 0x80(%r15), %rcx
cmpq %rcx, %rax
jge 0xc763
movb (%r15,%rax), %cl
movslq 0x110(%r12), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x110(%r12)
movb %cl, 0x90(%r12,%rdx)
incq %rax
jmp 0xc733
movq %r12, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xbcc1
addl %ebx, (%r14)
pushq $0x1
popq %rax
jmp 0xc779
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x18
popq %rdi
callq 0x2230
movq %rax, %rdi
callq 0xcd2d
movl $0x1, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc7d8
movslq %esi, %rsi
testq %rdi, %rdi
je 0xc7e1
callq 0x2260
jmp 0xc7e9
callq 0x2050
xorl %eax, %eax
jmp 0xc7f1
movq %rsi, %rdi
callq 0x2230
movq %rax, %rdi
callq 0xcd2d
movq %rax, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc810
movq %rdi, %rbx
decl 0x10(%rdi)
je 0xc812
popq %rbx
retq
movq (%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O2/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), %ecx
movq (%rdi), %rax
cmpl 0x8(%rdi), %ecx
jl 0xc86f
addq $0x401, %rsi            # imm = 0x401
movl %esi, 0x8(%rbx)
testq %rax, %rax
je 0xc85c
movq %rax, %rdi
callq 0x2260
jmp 0xc864
movq %rsi, %rdi
callq 0x2230
movq %rax, %rdi
callq 0xcd2d
movq %rax, (%rbx)
movslq 0xc(%rbx), %rdi
addq %rax, %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_O2/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
andl $0x0, 0x10(%rdi)
movq %rsi, %rdi
callq 0x22e0
movq %rax, %rdi
callq 0xcd2d
movq %rax, 0x8(%rbx)
andq $0x0, 0x18(%rbx)
andq $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc964
movq %rdi, %rbx
movslq 0x28(%rdi), %rcx
movl 0xc(%rax), %edx
xorl %r14d, %r14d
cmpl %ecx, %edx
jle 0xc967
movq (%rax), %r12
movq %rcx, %r15
addq %r12, %r15
subl %ecx, %edx
movslq %edx, %rdx
pushq $0xa
popq %rsi
movq %r15, %rdi
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 0xc967
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x914a(%rip), %rax      # 0x15af0
movq %rax, (%rdi)
movq %rdx, %rdi
callq 0x22e0
movq %rax, %rdi
callq 0xcd2d
movq %rax, 0x8(%rbx)
testq %r14, %r14
je 0xc9c6
incl 0x10(%r14)
movq %r14, 0x20(%rbx)
andl $0x0, 0x28(%rbx)
andl $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc9f2
callq 0xc802
testq %r14, %r14
je 0xc9fb
incl 0x10(%r14)
movq %r14, 0x20(%rbx)
andl $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x31fd(%rip), %rsi      # 0xfc7e
callq 0x2270
testq %rax, %rax
je 0xcae0
movq %rax, %rbx
pushq $0x30
popq %rdi
callq 0x2230
movq %rax, %rdi
callq 0xcd2d
movq %rax, %r14
leaq 0x9060(%rip), %rax      # 0x15b08
movq %rax, (%r14)
movq %r15, %rdi
callq 0x22e0
movq %rax, %rdi
callq 0xcd2d
movq %rax, 0x8(%r14)
movl $0x400, %edi            # imm = 0x400
callq 0x2230
movq %rax, %rdi
callq 0xcd2d
movq %rax, 0x28(%r14)
movq %rbx, 0x20(%r14)
andl $0x0, 0x10(%r14)
jmp 0xcae3
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
testq %r14, %r14
je 0xcb4b
movq %rdi, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
testq %rax, %rax
jne 0xcb4d
movq (%rbx), %rdi
movq (%rdi), %rax
movq 0x18(%rdi), %r14
callq *(%rax)
movq %r14, (%rbx)
testq %r14, %r14
jne 0xcb29
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcbb3
callq 0x21f0
xorl %r14d, %r14d
testl %eax, %eax
jne 0xcbd5
movl $0x4002, %ebp           # imm = 0x4002
movl $0x2801, %r15d          # imm = 0x2801
movq 0x20(%rbx), %rdi
callq 0x2160
leal 0x1(%rax), %edx
movl %r14d, %ecx
cmpl $0xe, %edx
ja 0xcb9e
btl %edx, %ebp
jb 0xcb7f
btl %edx, %r15d
jb 0xcbb8
cmpl $0x3fd, %r14d           # imm = 0x3FD
ja 0xcb7f
movq 0x28(%rbx), %rdx
incl %r14d
movb %al, (%rdx,%rcx)
jmp 0xcb7f
xorl %r14d, %r14d
jmp 0xcbd5
movq 0x28(%rbx), %rdx
movb $0xa, (%rdx,%rcx)
movq 0x28(%rbx), %rdx
movb $0x0, 0x1(%rdx,%rcx)
cmpl $0xa, %eax
jne 0xcbd1
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_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0xccaf
cmpb $0x0, (%r14)
je 0xcc71
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r12, %rdi
callq 0x22e0
movq %rax, %r12
movq %rax, %rdi
callq 0xcd2d
movq %r12, %rdi
callq 0xcd5b
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0xccaf
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0xcddb
cmpb $0x0, (%r14)
jne 0xcd21
incq %r12
movzbl -0x1(%r12), %eax
cmpl $0x3a, %eax
je 0xcce6
testl %eax, %eax
je 0xcd21
cmpl $0x5b, %eax
jne 0xcccd
jmp 0xccf3
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
jmp 0xccc2
pushq $0x5d
popq %rsi
movq %r12, %rdi
callq 0x20f0
testq %rax, %rax
je 0xcd21
incq %rax
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xcddb
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro11/util.c
// Function: memcheck
void           *memcheck(
    void *ptr)
{
    if (ptr == NULL) {
        fprintf(stderr, "Out of memory.\n");
        exit(EXIT_FAILURE);
    }

    return ptr;
}

// Assembly:
testq %rdi, %rdi
je 0xcd36
movq %rdi, %rax
retq
pushq %rax
movq 0x82ba(%rip), %rax      # 0x14ff8
movq (%rax), %rcx
leaq 0x2f5d(%rip), %rdi      # 0xfca5
pushq $0xf
popq %rsi
pushq $0x1
popq %rdx
callq 0x22d0
pushq $0x1
popq %rdi
callq 0x22c0
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x20e0
subl %eax, %ebp
addq %rax, %rbx
testl %ebp, %ebp
jle 0xcdd1
movb $0x20, (%rbx)
incq %rbx
decl %ebp
jmp 0xcdc3
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcf33
movq %r14, (%rbx)
movzbl (%r14), %r13d
xorl %r15d, %r15d
testq %r13, %r13
je 0xcffb
callq 0x2030
movq %rax, %r12
movq (%rax), %rax
movl (%rax,%r13,4), %esi
leaq 0x8bc7(%rip), %rdi      # 0x15b20
callq 0x20f0
testq %rax, %rax
je 0xcffb
leaq 0x8bb2(%rip), %rcx      # 0x15b20
subl %ecx, %eax
leaq 0x1(%r14), %rcx
testq %rbx, %rbx
je 0xcf7c
movq %rcx, (%rbx)
imull $0x640, %eax, %r15d     # imm = 0x640
movzbl (%rcx), %eax
testq %rax, %rax
je 0xcffb
movq (%r12), %rcx
movl (%rcx,%rax,4), %esi
leaq 0x8b87(%rip), %rdi      # 0x15b20
callq 0x20f0
testq %rax, %rax
je 0xcffb
leaq 0x8b76(%rip), %rcx      # 0x15b20
subl %ecx, %eax
imull $0x28, %eax, %r13d
leaq 0x2(%r14), %rax
testq %rbx, %rbx
je 0xcfbc
movq %rax, (%rbx)
addq %r15, %r13
movzbl (%rax), %eax
testq %rax, %rax
je 0xcff8
movq (%r12), %rcx
movl (%rcx,%rax,4), %esi
leaq 0x8b4b(%rip), %rdi      # 0x15b20
callq 0x20f0
testq %rax, %rax
je 0xcff8
testq %rbx, %rbx
je 0xcfeb
addq $0x3, %r14
movq %r14, (%rbx)
leaq 0x8b2e(%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_O2/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 0xcf1c
movl %eax, (%rbx)
andl $0x0, 0x4(%rbx)
movq (%r14), %rdi
cmpb $0x0, (%rdi)
je 0xd036
movq %rsp, %rsi
callq 0xcf1c
movl %eax, 0x4(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xd089
movw $0x640, %cx             # imm = 0x640
movl %edi, %eax
xorl %edx, %edx
divw %cx
movzwl %ax, %eax
leaq 0x8ac5(%rip), %r8       # 0x15b20
movb (%rax,%r8), %al
movb %al, (%rsi)
movw $0x28, %r9w
movl %edi, %eax
xorl %edx, %edx
divw %r9w
movl %edx, %ecx
xorl %edx, %edx
divw %r9w
movzwl %dx, %eax
movb (%rax,%r8), %al
movb %al, 0x1(%rsi)
movzwl %cx, %eax
movb (%rax,%r8), %al
jmp 0xd090
movw $0x2020, (%rsi)         # imm = 0x2020
movb $0x20, %al
movb %al, 0x2(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $-0x1
popq %rbx
testb %bpl, %bpl
je 0xd0cc
callq 0x2030
movq (%rax), %rax
movzbl %bpl, %ecx
movl (%rax,%rcx,4), %esi
leaq 0x8a69(%rip), %rdi      # 0x15b20
callq 0x20f0
testq %rax, %rax
je 0xd0cc
leaq 0x8a58(%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_O2/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 0xd10e
movsbl (%rdi), %eax
movb $0x28, %dl
idivb %dl
movsbl %ah, %eax
imull $0x640, %eax, %ecx      # imm = 0x640
cmpl $0x1, %esi
je 0xd110
movsbl 0x1(%rdi), %eax
idivb %dl
movsbl %ah, %eax
imull $0x28, %eax, %eax
addl %eax, %ecx
cmpl $0x3, %esi
jb 0xd110
movsbl 0x2(%rdi), %eax
idivb %dl
movsbl %ah, %eax
addl %eax, %ecx
jmp 0xd110
xorl %ecx, %ecx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2471
movl 0x8(%rdi), %eax
cmpl 0x8(%rsi), %eax
jne 0x2471
movl 0xc(%rdi), %eax
cmpl 0xc(%rsi), %eax
jne 0x2471
movq 0x18(%rdi), %rdi
movq 0x18(%rsi), %rsi
jmp 0x2474
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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), %ecx
xorl %eax, %eax
cmpw (%rsi), %cx
jne 0x24b2
cmpl $0x2, %ecx
je 0x24a4
cmpl $0xa, %ecx
jne 0x24b3
movl 0x8(%rdi), %ecx
cmpl 0x8(%rsi), %ecx
jne 0x24b2
movl 0xc(%rdi), %ecx
cmpl 0xc(%rsi), %ecx
jne 0x24b2
movl 0x10(%rdi), %ecx
cmpl 0x10(%rsi), %ecx
jne 0x24b2
pushq $0x14
jmp 0x24a6
pushq $0x4
popq %rcx
movl (%rdi,%rcx), %edx
xorl %eax, %eax
cmpl (%rsi,%rcx), %edx
sete %al
retq
pushq %rax
leaq 0x6c22(%rip), %rsi      # 0x90dd
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2240
// File: /workspace/github_c_makefile_star2_O2/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
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rbx
testq %r15, %r15
je 0x24ff
movq %r14, %r12
testq %r12, %r12
je 0x24f9
movq %r15, %rdi
movq %r12, %rsi
callq 0x244c
testl %eax, %eax
jne 0x2501
movq 0x28(%r12), %r12
jmp 0x24de
movq 0x28(%r15), %r15
jmp 0x24d6
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2560
cmpl $0x2, %r8d
jne 0x258c
movq 0x18(%rbx), %rax
cmpb $0x7f, 0x4(%rax)
sete %al
jmp 0x2578
movq 0x18(%rbx), %rax
cmpl $0x0, 0x8(%rax)
jne 0x2576
cmpl $0x0, 0xc(%rax)
jne 0x2576
cmpl $0x0, 0x10(%rax)
je 0x2583
xorl %eax, %eax
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x1000000, 0x14(%rax)  # imm = 0x1000000
jmp 0x255b
leaq 0x6a8d(%rip), %rdi      # 0x9020
leaq 0x6ac0(%rip), %r14      # 0x905a
pushq $0x2
popq %rdx
movl $0xbc, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x4998
movl 0x4(%rbx), %edx
pushq $0x1
popq %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/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 0x2606
cmpl $0x2, %eax
jne 0x2611
movl $0xf0, %eax
andl 0x4(%rdi), %eax
cmpl $0xe0, %eax
jmp 0x260a
cmpb $-0x1, 0x8(%rdi)
sete %al
movzbl %al, %eax
retq
pushq %rbx
leaq 0x6a07(%rip), %rdi      # 0x9020
leaq 0x6abd(%rip), %rbx      # 0x90dd
pushq $0x2
popq %rdx
movl $0x171, %esi            # imm = 0x171
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4998
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/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
xorl %ecx, %ecx
pushq $0x6
popq %rax
pushq $0x4
popq %rsi
leaq 0x69b5(%rip), %r8       # 0x9004
pushq $0x1
popq %r9
xorl %edx, %edx
testq %rdi, %rdi
je 0x268c
movl 0x4(%rdi), %r10d
cmpl $0xa, %r10d
movl $0x0, %r11d
cmovel %eax, %r11d
cmpl $0x2, %r10d
cmovel %esi, %r11d
movslq (%r8,%r11,4), %r10
addq %r8, %r10
jmpq *%r10
movl %r9d, %ecx
jmp 0x2686
movl %r9d, %edx
movq 0x28(%rdi), %rdi
jmp 0x2655
xorl %esi, %esi
xorl %edi, %edi
testl %ecx, %ecx
setne %dil
cmovel %eax, %esi
testl %edx, %edx
leal -0x1(%rdi,%rdi,4), %eax
cmovnel %esi, %eax
popq %rcx
retq
leaq 0x6975(%rip), %rdi      # 0x9020
leaq 0x6979(%rip), %rcx      # 0x902b
pushq $0x2
popq %rdx
movl $0x84, %esi
xorl %eax, %eax
callq 0x4998
leaq 0x697b(%rip), %rsi      # 0x9043
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2240
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
pushq $0x1
popq %rbp
testl %eax, %eax
jne 0x271a
xorl %eax, %eax
cmpq %rbx, %r14
je 0x271c
testq %r14, %r14
je 0x271c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x244c
movq 0x28(%r14), %r14
jmp 0x26f9
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r9d
leal -0x3(%rdx), %eax
cmpl $-0x2, %eax
setb %al
leal -0x3(%r9), %ecx
cmpl $-0x2, %ecx
setb %cl
orb %al, %cl
je 0x2744
pushq $-0x1
popq %rax
jmp 0x2781
movq %rsi, %rbx
movq %rdi, %r10
cmpl $0x1, %edx
cmoveq %rdi, %rsi
pushq $0x10
popq %rcx
movq %r8, %rdi
rep  movsq (%rsi), %es:(%rdi)
xorl %eax, %eax
cmpl %r9d, %edx
je 0x2781
cmpl $0x1, %r9d
cmoveq %r10, %rbx
movzwl (%rbx), %r9d
movl %r9d, %ecx
orl $0x8, %ecx
cmpl $0xa, %ecx
jne 0x2789
movzwl 0x2(%rbx), %ecx
movw %cx, 0x2(%r8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x6890(%rip), %rdi      # 0x9020
leaq 0x68d8(%rip), %r14      # 0x906f
pushq $0x2
popq %rdx
movl $0xff, %esi
movq %r14, %rcx
movl %r9d, %r8d
xorl %eax, %eax
callq 0x4998
movzwl (%rbx), %edx
pushq $0x1
popq %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/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), %eax
cmpl $0x2, %eax
je 0x27f9
cmpl $0xa, %eax
jne 0x27fd
pushq $0x1c
jmp 0x27fb
pushq $0x10
popq %rax
retq
pushq %rbx
leaq 0x681b(%rip), %rdi      # 0x9020
leaq 0x6837(%rip), %rbx      # 0x9043
pushq $0x2
popq %rdx
movl $0x1ca, %esi            # imm = 0x1CA
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4998
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/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 0x2856
movl %esi, %ebx
cmpl $0x2, %esi
jne 0x28a0
rolw $0x8, %dx
movw $0x2, (%rdi)
movw %dx, 0x2(%rdi)
andl $0x0, 0x4(%rdi)
andq $0x0, 0x8(%rdi)
jmp 0x2898
rolw $0x8, %dx
movq 0xc767(%rip), %rax      # 0xefc8
movl (%rax), %ecx
shlq $0x20, %rcx
movl 0xc(%rax), %esi
movl %esi, 0x10(%rsp)
movq 0x4(%rax), %rax
movq %rax, 0x8(%rsp)
movw $0xa, (%rdi)
movw %dx, 0x2(%rdi)
movq %rcx, 0x4(%rdi)
movq 0x8(%rsp), %rax
movq %rax, 0xc(%rdi)
movl 0x10(%rsp), %eax
movl %eax, 0x14(%rdi)
andl $0x0, 0x18(%rdi)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x6779(%rip), %rdi      # 0x9020
leaq 0x67ac(%rip), %r14      # 0x905a
pushq $0x2
popq %rdx
movl $0x12c, %esi            # imm = 0x12C
movq %r14, %rcx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x4998
pushq $0x1
popq %rdi
movq %r14, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
testl %edx, %edx
je 0x2918
cmpl $0x4, %edx
je 0x2911
cmpl $0x6, %edx
jne 0x2a00
pushq $0xa
jmp 0x2913
pushq $0x2
popq %rax
movl %eax, 0x14(%rsp)
movabsq $0x1100000002, %rax     # imm = 0x1100000002
leaq 0x10(%rsp), %r12
movq %rax, 0x8(%r12)
movl $0x1, (%r12)
movl %edx, (%rsp)
leaq 0x66e2(%rip), %rdi      # 0x9020
leaq 0x6752(%rip), %rcx      # 0x9097
pushq $0x2
popq %rdx
movl $0x151, %esi            # imm = 0x151
movq %rbx, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0x4998
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x2300
testl %eax, %eax
jne 0x29e2
callq 0x48ce
cmpl $0x3, %eax
jl 0x29cb
leaq 0x40(%rsp), %rbx
pushq $0x3e
popq %rbp
leaq 0x6693(%rip), %r15      # 0x9020
leaq 0x6d5a(%rip), %r12      # 0x96ee
pushq $0x3
popq %r13
movq (%r14), %r14
testq %r14, %r14
je 0x29cb
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x4860
movq %r15, %rdi
movl $0x15a, %esi            # imm = 0x15A
movl %r13d, %edx
movq %r12, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x4998
addq $0x28, %r14
jmp 0x2998
movq 0x8(%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x2130
leaq 0x66ce(%rip), %rsi      # 0x90be
pushq $0x1
popq %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x20f0
leaq 0x667e(%rip), %rsi      # 0x9085
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x20f0