LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_segment_apply_relocations
void xlink_segment_apply_relocations(xlink_segment *segment) {
  int i;
  for (i = 1; i <= segment->nrelocs; i++) {
    xlink_reloc *rel;
    unsigned char *data;
    int offset;
    int target;
    rel = xlink_segment_get_reloc(segment, i);
    data = segment->data + rel->offset;
    offset = segment->start + rel->offset;
    switch (rel->target) {
      case OMF_TARGET_EXT : {
        xlink_public *pub;
        pub = xlink_module_get_extern(segment->module, rel->target_idx)->public;
        target = pub->offset;
        if (pub->segment != NULL) {
          target += pub->segment->start;
        }
        break;
      }
      case OMF_TARGET_SEG : {
        xlink_segment *seg;
        seg = xlink_module_get_segment(segment->module, rel->target_idx);
        target = seg->start;
        break;
      }
      default : {
        XLINK_ERROR(1, ("Unsupported target T%i", rel->target));
      }
    }
    switch (rel->location) {
      case OMF_LOCATION_16BIT : {
        if (rel->mode == OMF_MODE_EXPLICIT) {
          *(uint16_t *)data = target + rel->addend.offset;
        }
        else {
          *(uint16_t *)data = target + rel->addend.offset - offset - 2;
        }
        break;
      }
      case OMF_LOCATION_32BIT : {
        if (rel->mode == OMF_MODE_EXPLICIT) {
          *(uint32_t *)data = target + rel->addend.offset;
        }
        else {
          *(uint32_t *)data = target + rel->addend.offset - offset - 4;
        }
        break;
      }
      default : {
        XLINK_ERROR(1, ("Unsupported location %i", rel->location));
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x78(%rdi)
jle 0x3c1e
movq %rdi, %rbx
xorl %ebp, %ebp
incl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2650
movq %rax, %r14
movq 0x38(%rbx), %r15
movl 0x18(%rax), %r12d
movl 0x28(%rax), %esi
movl 0x7c(%rbx), %r13d
addl %r12d, %r13d
cmpl $0x4, %esi
je 0x3bb5
cmpl $0x6, %esi
jne 0x3c36
movq 0x8(%rbx), %rdi
movl 0x30(%r14), %esi
callq 0x3106
movq 0x118(%rax), %rcx
movl 0x124(%rcx), %eax
movq 0x18(%rcx), %rcx
testq %rcx, %rcx
je 0x3bc5
addl 0x7c(%rcx), %eax
jmp 0x3bc5
movq 0x8(%rbx), %rdi
movl 0x30(%r14), %esi
callq 0x2e3e
movl 0x7c(%rax), %eax
movl 0x20(%r14), %esi
cmpl $0x9, %esi
je 0x3be7
cmpl $0x1, %esi
jne 0x3c2d
movl 0x3c(%r14), %ecx
cmpl $0x1, 0x1c(%r14)
jne 0x3c08
addl %eax, %ecx
movw %cx, (%r15,%r12)
jmp 0x3c15
movl 0x3c(%r14), %ecx
cmpl $0x1, 0x1c(%r14)
jne 0x3bfa
addl %eax, %ecx
movl %ecx, (%r15,%r12)
jmp 0x3c15
subl %r13d, %eax
addl %ecx, %eax
addl $-0x4, %eax
movl %eax, (%r15,%r12)
jmp 0x3c15
subl %r13d, %eax
addl %ecx, %eax
addl $-0x2, %eax
movw %ax, (%r15,%r12)
cmpl 0x78(%rbx), %ebp
jl 0x3b5e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6948(%rip), %rdi      # 0xa57c
jmp 0x3c3d
leaq 0x6bc4(%rip), %rdi      # 0xa801
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_omf_record_read_length
unsigned int xlink_omf_record_read_length(xlink_omf_record *rec) {
  unsigned int length;
  length = xlink_omf_record_read_byte(rec);
  switch (length) {
    case 0x81 : {
      return xlink_omf_record_read_word(rec);
    }
    case 0x84 : {
      length = xlink_omf_record_read_word(rec);
      return (xlink_omf_record_read_byte(rec) << 16) | length;
    }
    case 0x88 : {
      return xlink_omf_record_read_dword(rec);
    }
    default : {
      XLINK_ERROR(length > 0x80, ("Invalid length %i", length));
      return length;
    }
  }
}

// Assembly:
movq (%rdi), %rdx
movslq 0x8(%rdi), %rcx
leaq 0x1(%rcx), %rsi
movl %esi, 0x8(%rdi)
movzbl (%rdx,%rcx), %eax
cmpl $0x88, %eax
je 0x3cb3
cmpl $0x84, %eax
je 0x3c9e
cmpl $0x81, %eax
jne 0x3cbd
movzwl (%rdx,%rsi), %eax
addl $0x3, %ecx
jmp 0x3cb9
movzwl (%rdx,%rsi), %esi
leal 0x4(%rcx), %eax
movl %eax, 0x8(%rdi)
movzbl 0x3(%rdx,%rcx), %eax
shll $0x10, %eax
orl %esi, %eax
retq
movl (%rdx,%rsi), %eax
addl $0x5, %ecx
movl %ecx, 0x8(%rdi)
retq
cmpb $-0x7f, %al
jae 0x3cc2
retq
pushq %rax
leaq 0x6ba9(%rip), %rdi      # 0xa873
movl %eax, %esi
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_omf_record_read_string
const char *xlink_omf_record_read_string(xlink_omf_record *rec) {
  static char str[256];
  int len = xlink_omf_record_read_byte(rec);
  if (len != 0) {
    memcpy(str, &rec->buf[rec->idx], len);
  }
  str[len] = '\0';
  rec->idx += len;
  return str;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rsi
movslq 0x8(%rdi), %rcx
leaq 0x1(%rcx), %rax
movl %eax, 0x8(%rdi)
movzbl (%rsi,%rcx), %r14d
testq %r14, %r14
je 0x3d0e
addq %rax, %rsi
leaq 0xf82a(%rip), %rdi      # 0x13530
movq %r14, %rdx
callq 0x2130
leaq 0xf81b(%rip), %rax      # 0x13530
movb $0x0, (%r14,%rax)
addl %r14d, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_omf_record_read_lidata_block
unsigned int xlink_omf_record_read_lidata_block(xlink_omf_record *rec) {
  unsigned int repeat_count;
  unsigned int block_count;
  unsigned int size;
  repeat_count = xlink_omf_record_read_numeric(rec);
  block_count = xlink_omf_record_read_word(rec);
  printf("%i * ", repeat_count);
  if (block_count) {
    int i;
    printf("(");
    size = 0;
    for (i = 0; i < block_count; i++) {
      size += xlink_omf_record_read_lidata_block(rec);
      if (i > 0) printf(" + ");
    }
    printf(")");
  }
  else {
    size = xlink_omf_record_read_byte(rec);
    rec->idx += size;
    printf("%i", size);
  }
  return repeat_count * size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
testb $0x1, 0xc(%rdi)
movq (%rdi), %rcx
movslq 0x8(%rdi), %rax
jne 0x3d4a
movzwl (%rcx,%rax), %ebx
addl $0x2, %eax
jmp 0x3d50
movl (%rcx,%rax), %ebx
addl $0x4, %eax
movl %eax, 0x8(%r14)
movq (%r14), %rax
movslq 0x8(%r14), %rcx
movzwl (%rax,%rcx), %r13d
leal 0x2(%rcx), %eax
movl %eax, 0x8(%r14)
leaq 0x6b17(%rip), %rdi      # 0xa885
movl %ebx, %esi
xorl %eax, %eax
callq 0x20c0
testl %r13d, %r13d
je 0x3dc8
movl %ebx, 0x4(%rsp)
movl $0x28, %edi
callq 0x2040
leaq 0x6afa(%rip), %r12      # 0xa88b
xorl %ebx, %ebx
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x3d26
movl %eax, %ebp
testl %ebx, %ebx
je 0x3dae
movq %r12, %rdi
xorl %eax, %eax
callq 0x20c0
addl %ebp, %r15d
incl %ebx
cmpl %ebx, %r13d
jne 0x3d96
movl $0x29, %edi
callq 0x2040
movl 0x4(%rsp), %ebx
jmp 0x3df5
movq (%r14), %rax
movslq 0x8(%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x8(%r14)
movzbl (%rax,%rcx), %r15d
leal 0x1(%rcx,%r15), %eax
movl %eax, 0x8(%r14)
leaq 0x70fd(%rip), %rdi      # 0xaee8
movl %r15d, %esi
xorl %eax, %eax
callq 0x20c0
imull %ebx, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_omf_dump_records
void xlink_omf_dump_records(xlink_omf *omf) {
  int i;
  xlink_omf_record *rec;
  printf("Summary of records:\n");
  for (i = 0, rec = omf->records; i < omf->nrecords; i++, rec++) {
    printf("  %02Xh %-7s - %-32s%6i bytes%s\n", rec->type,
     xlink_omf_record_get_name(rec->type), xlink_omf_record_get_desc(rec->type),
     3 + rec->size - 1, rec->type & 1 ? " 32-bit" : "");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x7ea8(%rip), %rdi      # 0xbcc8
callq 0x2060
cmpl $0x0, 0x8(%rbx)
jle 0x3ea9
movq (%rbx), %r12
addq $0xe, %r12
leaq 0x6a77(%rip), %rbp      # 0xa8b0
leaq 0x6a4f(%rip), %r14      # 0xa88f
xorl %r13d, %r13d
movzbl -0x2(%r12), %r15d
movl %r15d, %edi
callq 0x2d1f
leal -0x80(%r15), %edx
leaq 0x7930(%rip), %rcx      # 0xb78c
cmpl $0x4b, %edx
ja 0x3e71
shrl %edx
leaq 0x63b6(%rip), %rsi      # 0xa220
movslq (%rsi,%rdx,4), %rcx
addq %rsi, %rcx
movzwl (%r12), %r8d
addl $0x2, %r8d
testb $0x1, %r15b
movq %rbp, %r9
leaq 0x7669(%rip), %rdx      # 0xb4f1
cmoveq %rdx, %r9
movq %r14, %rdi
movl %r15d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x20c0
incl %r13d
addq $0x10, %r12
cmpl 0x8(%rbx), %r13d
jl 0x3e43
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_omf_dump_lxdata
void xlink_omf_dump_lxdata(xlink_omf *omf, xlink_module *mod) {
  int i;
  xlink_omf_record *rec;
  printf("LEDATA, LIDATA, COMDAT and FIXUPP records:\n");
  for (i = 0, rec = omf->records; i < omf->nrecords; i++, rec++) {
    xlink_segment *seg;
    int offset;
    xlink_omf_record_reset(rec);
    switch (rec->type & ~1) {
      case OMF_LEDATA : {
        seg = xlink_module_get_segment(mod, xlink_omf_record_read_index(rec));
        offset = xlink_omf_record_read_numeric(rec);
        printf("  LEDATA: segment %8s, offset 0x%04x, size 0x%04x\n",
         xlink_segment_get_name(seg), offset, 3 + rec->size - 1 - rec->idx);
        break;
      }
      case OMF_LIDATA : {
        seg = xlink_module_get_segment(mod, xlink_omf_record_read_index(rec));
        offset = xlink_omf_record_read_numeric(rec);
        printf("  LIDATA: segment %8s, offset 0x%04x, size ",
         xlink_segment_get_name(seg), offset);
        printf(" = 0x%04x\n", xlink_omf_record_read_lidata_block(rec));
        break;
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x7e0c(%rip), %rdi      # 0xbcdc
callq 0x2060
cmpl $0x0, 0x8(%r14)
jle 0x4044
movq (%r14), %r15
leaq 0xf146(%rip), %r12      # 0x13030
xorl %r13d, %r13d
movl $0x3, 0x8(%r15)
movzbl 0xc(%r15), %eax
andl $-0x2, %eax
cmpl $0xa2, %eax
je 0x3f56
cmpl $0xa0, %eax
jne 0x4033
movq (%r15), %rax
movl $0x4, 0x8(%r15)
movzbl 0x3(%rax), %esi
testb %sil, %sil
jns 0x3f37
andl $0x7f, %esi
shll $0x8, %esi
movl $0x5, 0x8(%r15)
movzbl 0x4(%rax), %eax
orl %eax, %esi
movq %rbx, %rdi
callq 0x2e3e
testb $0x1, 0xc(%r15)
movq (%r15), %rdx
movslq 0x8(%r15), %rcx
jne 0x3f9d
movzwl (%rdx,%rcx), %ebp
addl $0x2, %ecx
jmp 0x3fa3
movq (%r15), %rax
movl $0x4, 0x8(%r15)
movzbl 0x3(%rax), %esi
testb %sil, %sil
jns 0x3f7e
andl $0x7f, %esi
shll $0x8, %esi
movl $0x5, 0x8(%r15)
movzbl 0x4(%rax), %eax
orl %eax, %esi
movq %rbx, %rdi
callq 0x2e3e
testb $0x1, 0xc(%r15)
movq (%r15), %rdx
movslq 0x8(%r15), %rcx
jne 0x3fe3
movzwl (%rdx,%rcx), %ebp
addl $0x2, %ecx
jmp 0x3fe9
movl (%rdx,%rcx), %ebp
addl $0x4, %ecx
movl %ecx, 0x8(%r15)
movq 0x20(%rax), %rdx
addq $0x10, %rdx
movl (%rax), %ecx
movq %r12, %rdi
leaq 0x6ba5(%rip), %rsi      # 0xab60
xorl %eax, %eax
callq 0x21e0
movzwl 0xe(%r15), %ecx
subl 0x8(%r15), %ecx
addl $0x2, %ecx
leaq 0x68e3(%rip), %rdi      # 0xa8b8
movq %r12, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x20c0
jmp 0x4033
movl (%rdx,%rcx), %ebp
addl $0x4, %ecx
movl %ecx, 0x8(%r15)
movq 0x20(%rax), %rdx
addq $0x10, %rdx
movl (%rax), %ecx
movq %r12, %rdi
leaq 0x6b5f(%rip), %rsi      # 0xab60
xorl %eax, %eax
callq 0x21e0
leaq 0x68dc(%rip), %rdi      # 0xa8eb
movq %r12, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x20c0
movq %r15, %rdi
callq 0x3d26
leaq 0x68ed(%rip), %rdi      # 0xa917
movl %eax, %esi
xorl %eax, %eax
callq 0x20c0
incl %r13d
addq $0x10, %r15
cmpl 0x8(%r14), %r13d
jl 0x3eed
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_module_dump_names
void xlink_module_dump_names(xlink_module *mod) {
  int i;
  if (mod->nnames > 0) {
    printf("Local names:\n");
    for (i = 1; i <= mod->nnames; i++) {
      char buf[256];
      sprintf(buf, "'%s'", xlink_module_get_name(mod, i)->str);
      printf("%2i : %8s\n", i, buf);
    }
  }
}

// Assembly:
cmpl $0x0, 0x120(%rdi)
jle 0x40d9
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %rbx
leaq 0x7c92(%rip), %rdi      # 0xbd07
callq 0x2060
cmpl $0x0, 0x120(%rbx)
jle 0x40ca
leaq 0x6dd2(%rip), %r14      # 0xae5c
movq %rsp, %r15
leaq 0x688e(%rip), %r12      # 0xa922
xorl %ebp, %ebp
incl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2d8c
leaq 0x10(%rax), %rdx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x21e0
movq %r12, %rdi
movl %ebp, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x20c0
cmpl 0x120(%rbx), %ebp
jl 0x4096
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_module_dump_symbols
void xlink_module_dump_symbols(xlink_module *mod) {
  int i;
  if (mod->npublics > 0) {
    printf("Public names:\n");
    for (i = 1; i <= mod->npublics; i++) {
      xlink_public *pub;
      char buf[256];
      pub = xlink_module_get_public(mod, i);
      sprintf(buf, "'%s'", pub->name);
      printf("%2i : %16s %c group %8s, segment %8s, offset 0x%04x, type %i\n",
       i, buf, pub->is_local ? 'L' : ' ',
       pub->group ? xlink_group_get_name(pub->group) : ":0",
       pub->segment ? xlink_segment_get_name(pub->segment) : ":0",
       pub->offset, pub->type_idx);
    }
  }
  if (mod->nexterns > 0) {
    printf("External names:\n");
    for (i = 1; i <= mod->nexterns; i++) {
      xlink_extern *ext;
      char buf[256];
      ext = xlink_module_get_extern(mod, i);
      sprintf(buf, "'%s'", ext->name);
      printf("%2i : %16s %c type %i\n", i, buf, ext->is_local ? 'L' : ' ',
       ext->type_idx);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
cmpl $0x0, 0x150(%rdi)
jle 0x4201
leaq 0x7c12(%rip), %rdi      # 0xbd14
callq 0x2060
cmpl $0x0, 0x150(%rbx)
jle 0x4201
movq %rsp, %r14
xorl %r12d, %r12d
incl %r12d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2fa2
movq %rax, %r13
leaq 0x24(%rax), %rdx
movq %r14, %rdi
leaq 0x6d23(%rip), %rsi      # 0xae5c
xorl %eax, %eax
callq 0x21e0
cmpl $0x0, 0x12c(%r13)
movl $0x4c, %ebp
movl $0x20, %eax
cmovel %eax, %ebp
movq 0x10(%r13), %rax
leaq 0x680b(%rip), %r14      # 0xa96b
testq %rax, %rax
je 0x4187
movq 0x10(%rax), %rdx
addq $0x10, %rdx
movl (%rax), %ecx
leaq 0xf0ba(%rip), %r14      # 0x13230
movq %r14, %rdi
leaq 0x69e0(%rip), %rsi      # 0xab60
xorl %eax, %eax
callq 0x21e0
movq 0x18(%r13), %rax
leaq 0x67d9(%rip), %r9       # 0xa96b
testq %rax, %rax
je 0x41c2
movq 0x20(%rax), %rdx
addq $0x10, %rdx
movl (%rax), %ecx
movq %rbx, %r15
leaq 0xee85(%rip), %rbx      # 0x13030
movq %rbx, %rdi
leaq 0x69ab(%rip), %rsi      # 0xab60
xorl %eax, %eax
callq 0x21e0
movq %rbx, %r9
movq %r15, %rbx
movl 0x124(%r13), %r10d
movl 0x128(%r13), %r11d
leaq 0x6756(%rip), %rdi      # 0xa92d
movl %r12d, %esi
movq %rsp, %rdx
movl %ebp, %ecx
movq %r14, %r8
movq %rdx, %r14
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x20c0
addq $0x10, %rsp
cmpl 0x150(%rbx), %r12d
jl 0x411a
cmpl $0x0, 0x160(%rbx)
jle 0x4284
leaq 0x7b11(%rip), %rdi      # 0xbd22
callq 0x2060
cmpl $0x0, 0x160(%rbx)
jle 0x4284
movq %rsp, %r15
movl $0x20, %r14d
leaq 0x673f(%rip), %r12      # 0xa96e
xorl %ebp, %ebp
incl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3106
movq %rax, %r13
leaq 0x10(%rax), %rdx
movq %r15, %rdi
leaq 0x6c0e(%rip), %rsi      # 0xae5c
xorl %eax, %eax
callq 0x21e0
cmpl $0x0, 0x114(%r13)
movl $0x4c, %ecx
cmovel %r14d, %ecx
movl 0x110(%r13), %r8d
movq %r12, %rdi
movl %ebp, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x20c0
cmpl 0x160(%rbx), %ebp
jl 0x4231
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_module_dump_segments
void xlink_module_dump_segments(xlink_module *mod) {
  int i, j;
  printf("Segment records:\n");
  for (i = 1; i <= mod->nsegments; i++) {
    xlink_segment *seg;
    seg = xlink_module_get_segment(mod, i);
    printf("%2i : %6s segment %s %s %s %6s 0x%04x bytes%s\n", i, seg->name->str,
     OMF_SEGDEF_ALIGN[seg->attrib.align], OMF_SEGDEF_USE[seg->attrib.proc],
     OMF_SEGDEF_COMBINE[seg->attrib.combine], xlink_segment_get_class_name(seg),
     seg->length, seg->attrib.big ? ", big" : "");
  }
  for (i = 1; i <= mod->ngroups; i++) {
    xlink_group *grp;
    grp = xlink_module_get_group(mod, i);
    printf("Group: %s\n", xlink_group_get_name(grp));
    for (j = 1; j <= grp->nsegments; j++) {
      printf("%2i : segment %8s\n", j,
       xlink_segment_get_name(xlink_group_get_segment(grp, j)));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x7a87(%rip), %rdi      # 0xbd32
callq 0x2060
cmpl $0x0, 0x130(%rbx)
movq %rbx, (%rsp)
jle 0x4386
xorl %ebp, %ebp
incl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2e3e
movq %rax, %r13
movq 0x20(%rax), %rbx
movq 0x28(%rax), %rdx
addq $0x10, %rbx
movzbl 0x10(%rax), %eax
movl %eax, %ecx
shrl $0x5, %ecx
leaq 0xb7d2(%rip), %rsi      # 0xfac0
movq (%rsi,%rcx,8), %r15
movl %eax, %ecx
andl $0x1, %ecx
leaq 0xb802(%rip), %rsi      # 0xfb00
movq (%rsi,%rcx,8), %r12
andl $0x1c, %eax
leaq 0xb804(%rip), %rcx      # 0xfb10
movq (%rcx,%rax,2), %r14
addq $0x10, %rdx
leaq 0xee15(%rip), %rdi      # 0x13130
leaq 0x6b3a(%rip), %rsi      # 0xae5c
xorl %eax, %eax
callq 0x21e0
testb $0x2, 0x10(%r13)
movl 0x1c(%r13), %r10d
leaq 0x651c(%rip), %r11      # 0xa855
leaq 0x71b1(%rip), %rax      # 0xb4f1
cmoveq %rax, %r11
subq $0x8, %rsp
leaq 0x6636(%rip), %rdi      # 0xa985
movl %ebp, %esi
movq %rbx, %rdx
movq 0x8(%rsp), %rbx
movq %r15, %rcx
movq %r12, %r8
movq %r14, %r9
xorl %eax, %eax
pushq %r11
pushq %r10
leaq 0xedc1(%rip), %r10      # 0x13130
pushq %r10
callq 0x20c0
addq $0x20, %rsp
cmpl 0x130(%rbx), %ebp
jl 0x42c3
cmpl $0x0, 0x140(%rbx)
jle 0x4444
movl $0x1, %r15d
leaq 0x67c0(%rip), %r12      # 0xab60
leaq 0xec89(%rip), %rbp      # 0x13030
leaq 0x6611(%rip), %r13      # 0xa9bf
movq %rbx, %rdi
movl %r15d, %esi
callq 0x2ef0
movq %rax, %r14
movq 0x10(%rax), %rdx
addq $0x10, %rdx
movl (%rax), %ecx
leaq 0xee63(%rip), %rbx      # 0x13230
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x21e0
leaq 0x65d3(%rip), %rdi      # 0xa9b4
movq %rbx, %rsi
xorl %eax, %eax
callq 0x20c0
cmpl $0x0, 0x20(%r14)
jle 0x442c
xorl %ebx, %ebx
incl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x27fc
movq 0x20(%rax), %rdx
addq $0x10, %rdx
movl (%rax), %ecx
movq %rbp, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x21e0
movq %r13, %rdi
movl %ebx, %esi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x20c0
cmpl 0x20(%r14), %ebx
jl 0x43f4
leal 0x1(%r15), %eax
movq (%rsp), %rbx
cmpl 0x140(%rbx), %r15d
movl %eax, %r15d
jl 0x43ae
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_omf_record_load_iterated
int xlink_omf_record_load_iterated(xlink_omf_record *rec, unsigned char *data,
 int length) {
  unsigned char *block;
  unsigned int repeat_count;
  unsigned int block_count;
  unsigned int size;
  int i;
  block = data;
  repeat_count = xlink_omf_record_read_numeric(rec);
  block_count = xlink_omf_record_read_word(rec);
  if (block_count) {
    size = 0;
    for (i = 0; i < block_count; i++) {
      int block_size;
      block_size = xlink_omf_record_load_iterated(rec, block, length);
      block += block_size;
      length -= block_size;
      size += block_size;
    }
  }
  else {
    size = xlink_omf_record_read_byte(rec);
    XLINK_ERROR(size > length,
     ("LIDATA wrote past end of segment, size = %i but length = %i", size,
     length));
    memcpy(block, &rec->buf[rec->idx], size);
    block += size;
    rec->idx += size;
  }
  for (i = 1; i < repeat_count; i++) {
    memcpy(block, data, size);
    block += size;
  }
  return repeat_count*size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
testb $0x1, 0xc(%rdi)
movq (%rdi), %rcx
movslq 0x8(%rdi), %rax
jne 0x4b97
movzwl (%rcx,%rax), %ecx
movq %rcx, (%rsp)
addl $0x2, %eax
jmp 0x4ba1
movl (%rcx,%rax), %ecx
movq %rcx, (%rsp)
addl $0x4, %eax
movl %eax, 0x8(%r14)
movq (%r14), %rsi
movslq 0x8(%r14), %rax
movzwl (%rsi,%rax), %r13d
leaq 0x2(%rax), %rcx
movl %ecx, 0x8(%r14)
testl %r13d, %r13d
je 0x4be2
xorl %ebp, %ebp
movq %rbx, %r12
movq %r14, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x4b69
cltq
addq %rax, %r12
subl %eax, %r15d
addl %eax, %ebp
decl %r13d
jne 0x4bc3
jmp 0x4c0b
addq $0x3, %rax
movl %eax, 0x8(%r14)
movzbl (%rsi,%rcx), %ebp
cmpl %r15d, %ebp
ja 0x4c47
addq %rax, %rsi
movl %ebp, %r12d
movq %rbx, %rdi
movq %r12, %rdx
callq 0x2130
addq %rbx, %r12
addl %ebp, 0x8(%r14)
movq (%rsp), %r13
cmpl $0x2, %r13d
jb 0x4c32
movl %ebp, %r14d
leal -0x1(%r13), %r15d
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2130
addq %r14, %r12
decl %r15d
jne 0x4c1c
imull %r13d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5e4f(%rip), %rdi      # 0xaa9d
movl %ebp, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_file_load_omf_record
static void xlink_file_load_omf_record(xlink_file *file,
 xlink_omf_record *rec) {
  unsigned char checksum;
  XLINK_ERROR(file->size < 3,
   ("Need 3 bytes for a record but only have %i", file->size));
  rec->buf = &file->buf[file->pos];
  rec->idx = 0;
  rec->type = xlink_omf_record_read_byte(rec);
  rec->size = xlink_omf_record_read_word(rec);
  XLINK_ERROR(file->size - 3 < rec->size,
   ("Record extends %i bytes past the end of file %s",
   rec->size - file->size + 3, file->name));
  file->pos += 3 + rec->size;
  file->size -= 3 + rec->size;
  checksum = rec->buf[3 + rec->size - 1];
  if (checksum != 0) {
    int i;
    for (i = 0; i < 3 + rec->size - 1; i++) {
      checksum += rec->buf[i];
    }
  }
  XLINK_ERROR(checksum != 0, ("Invalid checksum, expected 0 got %i", checksum));
}

// Assembly:
pushq %rax
movl 0x8(%rdi), %eax
cmpl $0x2, %eax
jbe 0x5d46
movq %rsi, %rcx
movq 0x10(%rdi), %rsi
movl 0xc(%rdi), %r8d
leaq (%rsi,%r8), %rdx
movq %rdx, (%rcx)
movl $0x1, 0x8(%rcx)
movb (%rsi,%r8), %r9b
movb %r9b, 0xc(%rcx)
movzwl 0x1(%rsi,%r8), %esi
movl $0x3, 0x8(%rcx)
movw %si, 0xe(%rcx)
leal -0x3(%rax), %ecx
cmpl %esi, %ecx
jb 0x5d51
leal 0x3(%rsi), %ecx
addl %esi, %r8d
addl $0x3, %r8d
movl %r8d, 0xc(%rdi)
subl %ecx, %eax
movl %eax, 0x8(%rdi)
movl %esi, %eax
movb 0x2(%rdx,%rax), %al
testb %al, %al
je 0x5d40
addq $0x2, %rsi
xorl %ecx, %ecx
addb (%rdx,%rcx), %al
incq %rcx
cmpq %rcx, %rsi
jne 0x5d35
testb %al, %al
jne 0x5d69
popq %rax
retq
leaq 0x5abf(%rip), %rdi      # 0xb80c
movl %eax, %esi
jmp 0x5d73
subl %eax, %esi
addl $0x3, %esi
movq (%rdi), %rdx
leaq 0x5ad7(%rip), %rdi      # 0xb837
xorl %eax, %eax
callq 0x22ef
jmp 0x5d7a
movzbl %al, %esi
leaq 0x5af4(%rip), %rdi      # 0xb867
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_file_load_omf_library
xlink_library *xlink_file_load_omf_library(xlink_file *file,
 unsigned int flags) {
  xlink_library *lib;
  int done;
  lib = xlink_malloc(sizeof(xlink_library));
  done = 0;
  while (file->size > 0 && !done) {
    switch (file->buf[file->pos]) {
      case OMF_LIBHDR : {
        xlink_omf_record rec;
        xlink_file_load_omf_record(file, &rec);
        lib->page_size = rec.size + 3;
        break;
      }
      case OMF_LIBEND : {
        done = 1;
        break;
      }
      case OMF_THEADR :
      case OMF_LHEADR : {
        int mask;
        int skip;
        xlink_module *mod;
        /* TODO: Find embedded module name in dictionary, set file->name here */
        mod = xlink_file_load_omf_module(file, flags);
        XLINK_LIST_ADD(library, module, lib, mod);
        /* Page size is always a power of two */
        mask = lib->page_size - 1;
        /* Compute the number of bytes to skip to reach the next page */
        skip = ((file->pos + mask) & ~mask) - file->pos;
        file->pos += skip;
        file->size -= skip;
        break;
      }
      default : {
        XLINK_ERROR(1, ("Unknown record type %02X", file->buf[file->pos]));
      }
    }
  }
  XLINK_ERROR(!done, ("Got EOF before reading LIBEND in %s", file->name));
  return lib;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl $0x30, %edi
callq 0x8508
cmpl $0x0, 0x8(%rbx)
je 0x5eac
movq %rax, %r14
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
movq 0x10(%rbx), %rax
movl 0xc(%rbx), %ecx
movzbl (%rax,%rcx), %esi
cmpl $0xef, %esi
jg 0x5e3e
cmpl $0x80, %esi
je 0x5ddd
cmpl $0x82, %esi
jne 0x5e94
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4c64
movq %rax, %r12
movl 0x28(%r14), %eax
incl %eax
movl %eax, 0x8(%r12)
movq %r14, 0x10(%r12)
movslq 0x28(%r14), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x28(%r14)
movq 0x20(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x852c
movq %rax, 0x20(%r14)
movslq 0x28(%r14), %rcx
movq %r12, -0x8(%rax,%rcx,8)
movl 0x18(%r14), %eax
movl 0xc(%rbx), %ecx
leal (%rax,%rcx), %edx
decl %edx
negl %eax
andl %edx, %eax
subl %eax, %ecx
movl %eax, 0xc(%rbx)
addl %ecx, 0x8(%rbx)
jmp 0x5e6a
movl $0x1, %eax
cmpl $0xf1, %esi
je 0x5e6d
cmpl $0xf0, %esi
jne 0x5e94
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5cd0
movzwl 0x16(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x18(%r14)
movl %r13d, %eax
cmpl $0x0, 0x8(%rbx)
je 0x5e7e
movl %eax, %r13d
testl %eax, %eax
je 0x5db6
testl %eax, %eax
je 0x5eac
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4e90(%rip), %rdi      # 0xad2b
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
movq (%rbx), %rsi
leaq 0x4e8e(%rip), %rdi      # 0xad44
xorl %eax, %eax
callq 0x22ef
jmp 0x5ea2
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: seg_comp
int seg_comp(const void *a, const void *b) {
  const xlink_segment *seg_a;
  const xlink_segment *seg_b;
  seg_a = *(xlink_segment **)a;
  seg_b = *(xlink_segment **)b;
  if (xlink_segment_get_class(seg_a) == xlink_segment_get_class(seg_b)) {
    if (seg_a->attrib.proc == seg_b->attrib.proc) {
      if (seg_a->module == seg_b->module) {
        return seg_a->index - seg_b->index;
      }
      return seg_a->module->index - seg_b->module->index;
    }
    return seg_a->attrib.proc - seg_b->attrib.proc;
  }
  return xlink_segment_get_class(seg_a) - xlink_segment_get_class(seg_b);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %r15
movq (%rsi), %r14
movq 0x28(%r15), %rdi
addq $0x10, %rdi
leaq 0x4e5d(%rip), %rsi      # 0xad68
callq 0x2100
movl %eax, %ebx
xorl %ebp, %ebp
movl $0x0, %r12d
testl %eax, %eax
je 0x5f2e
movl 0x30(%r15), %eax
andl $0x1, %eax
movl $0x2, %r12d
subl %eax, %r12d
movq 0x28(%r14), %rdi
addq $0x10, %rdi
leaq 0x4e2b(%rip), %rsi      # 0xad68
callq 0x2100
movl %eax, %ecx
testl %eax, %eax
je 0x5f56
movl 0x30(%r14), %eax
andl $0x1, %eax
movl $0x2, %ebp
subl %eax, %ebp
cmpl %ebp, %r12d
jne 0x5f84
movzbl 0x10(%r15), %eax
andl $0x1, %eax
movzbl 0x10(%r14), %ecx
andl $0x1, %ecx
cmpb %cl, %al
jne 0x5fac
movq 0x8(%r15), %rax
movq 0x8(%r14), %rcx
cmpq %rcx, %rax
je 0x5fb0
movl 0x8(%rax), %eax
subl 0x8(%rcx), %eax
jmp 0x5fb6
xorl %eax, %eax
movl $0x0, %edx
testl %ebx, %ebx
je 0x5f9d
movl 0x30(%r15), %esi
andl $0x1, %esi
movl $0x2, %edx
subl %esi, %edx
testl %ecx, %ecx
je 0x5fa8
movl 0x30(%r14), %eax
orl $-0x2, %eax
addl %edx, %eax
jmp 0x5fb6
subl %ecx, %eax
jmp 0x5fb6
movl (%r15), %eax
subl (%r14), %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_binary_link_root_segment
void xlink_binary_link_root_segment(xlink_binary *bin, xlink_segment *root) {
  int i;
  xlink_binary_process_segment(bin, root);
  for (i = 1; i <= bin->nexterns; i++) {
    xlink_extern *ext;
    ext = xlink_binary_get_extern(bin, i);
    if (ext->is_local) {
      ext->public = xlink_module_find_public(ext->module, ext->name);
    }
    else {
      ext->public = xlink_binary_find_public(bin, ext->name);
    }
    if (ext->public->segment != NULL) {
      xlink_binary_process_segment(bin, ext->public->segment);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x3876
cmpl $0x0, 0x60(%rbx)
jle 0x6029
xorl %ebp, %ebp
incl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x381f
movq %rax, %r14
cmpl $0x0, 0x114(%rax)
je 0x5ffd
movq 0x8(%r14), %rdi
movq %r14, %rsi
addq $0x10, %rsi
callq 0x32b3
jmp 0x600c
movq %r14, %rsi
addq $0x10, %rsi
movq %rbx, %rdi
callq 0x359a
movq %rax, 0x118(%r14)
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x6024
movq %rbx, %rdi
callq 0x3876
cmpl 0x60(%rbx), %ebp
jl 0x5fd3
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_sort_segments
void xlink_sort_segments(xlink_segment **segments, int nsegments, int *data_idx,
 int *bss_idx) {
  int i;
  qsort(segments, nsegments, sizeof(xlink_segment *), seg_comp);
  if (data_idx != NULL) {
    for (i = 0; i < nsegments; i++) {
      if (xlink_segment_get_class(segments[i]) == OMF_SEGMENT_DATA) break;
    }
    *data_idx = i;
  }
  if (bss_idx != NULL) {
    for (i = 0; i < nsegments; i++) {
      if (xlink_segment_get_class(segments[i]) == OMF_SEGMENT_BSS) break;
    }
    *bss_idx = i;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %r14
movslq %esi, %r12
leaq -0x163(%rip), %rcx      # 0x5eee
movl $0x8, %edx
movq %r12, %rsi
callq 0x2070
movl %r12d, %ebx
testq %r13, %r13
je 0x60ba
movq %r13, 0x10(%rsp)
testl %ebp, %ebp
jle 0x60af
movq %r15, 0x8(%rsp)
xorl %r13d, %r13d
leaq 0x4cea(%rip), %r12      # 0xad68
movq (%r14,%r13,8), %r15
movq 0x28(%r15), %rdi
addq $0x10, %rdi
movq %r12, %rsi
callq 0x2100
testl %eax, %eax
je 0x609d
testb $0x1, 0x30(%r15)
jne 0x60a8
incq %r13
cmpq %r13, %rbx
jne 0x607e
movl %ebx, %r13d
movq 0x8(%rsp), %r15
jmp 0x60b2
xorl %r13d, %r13d
movq 0x10(%rsp), %rax
movl %r13d, (%rax)
testq %r15, %r15
je 0x6105
testl %ebp, %ebp
jle 0x60ff
movq %r15, %rbp
xorl %r12d, %r12d
leaq 0x4c98(%rip), %r15      # 0xad68
movq (%r14,%r12,8), %r13
movq 0x28(%r13), %rdi
addq $0x10, %rdi
movq %r15, %rsi
callq 0x2100
testl %eax, %eax
je 0x60ef
testb $0x1, 0x30(%r13)
je 0x60fa
incq %r12
cmpq %r12, %rbx
jne 0x60d0
movl %ebx, %r12d
movq %rbp, %r15
jmp 0x6102
xorl %r12d, %r12d
movl %r12d, (%r15)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_set_first_segment
void xlink_set_first_segment(xlink_segment **segments, xlink_segment *first) {
  int i;
  for (i = 0; segments[i] != first; i++);
  memmove(&segments[1], &segments[0], sizeof(*segments)*i);
  segments[0] = first;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq $-0x8, %rdx
movq %rdx, %rax
addq $0x8, %rdx
cmpq %rbx, 0x8(%r14,%rax)
jne 0x6125
leaq 0x8(%r14), %rdi
movq %r14, %rsi
callq 0x21a0
movq %rbx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_binary_layout_segments
void xlink_binary_layout_segments(xlink_binary *bin, int index, int offset) {
  int i;
  for (i = index + 1; i <= bin->nsegments; i++) {
    xlink_segment *seg;
    seg = xlink_binary_get_segment(bin, i);
    /* If this is a 32-bit program, move all 32-bit BSS above the first 64k */
    if (bin->is_32bit && seg->attrib.proc == OMF_SEGMENT_USE32 &&
     xlink_segment_get_class(seg) == OMF_SEGMENT_BSS && offset < 0x10000) {
      offset = 0x10000;
    }
    offset = ALIGN2(offset, xlink_segment_get_alignment(seg));
    seg->start = offset;
    offset += seg->length;
  }
  XLINK_ERROR(!bin->is_32bit && offset > 65536,
   ("Address space exceeds 65536 bytes, %i", offset));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rdi, %rbx
cmpl %esi, 0x50(%rdi)
jle 0x6203
movl %esi, %ebp
leaq 0x4bfb(%rip), %r14      # 0xad68
incl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x378b
movq %rax, %r12
cmpl $0x0, 0x64(%rbx)
je 0x61c2
testb $0x1, 0x10(%r12)
je 0x61c2
movq 0x28(%r12), %rdi
addq $0x10, %rdi
movq %r14, %rsi
callq 0x2100
testl %eax, %eax
je 0x61aa
testb $0x1, 0x30(%r12)
sete %al
jmp 0x61ac
xorl %eax, %eax
cmpl $0x10001, %r15d         # imm = 0x10001
movl $0x10000, %ecx          # imm = 0x10000
cmovgel %r15d, %ecx
testb %al, %al
cmovnel %ecx, %r15d
movq %r12, %rdi
callq 0x274a
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl %eax, %ecx
shll %cl, %r13d
notl %r13d
addl %r15d, %r13d
movq %r12, %rdi
callq 0x274a
movl %eax, %ecx
shrl %cl, %r13d
shll %cl, %r13d
movl %r13d, 0x7c(%r12)
addl 0x1c(%r12), %r13d
movl %r13d, %r15d
cmpl 0x50(%rbx), %ebp
jl 0x616d
jmp 0x6206
movl %r15d, %r13d
cmpl $0x0, 0x64(%rbx)
jne 0x6215
cmpl $0x10001, %r13d         # imm = 0x10001
jge 0x6224
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4b42(%rip), %rdi      # 0xad6d
movl %r13d, %esi
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_binary_extract_class
int xlink_binary_extract_class(xlink_binary *bin, int index, int offset,
 xlink_segment_class class, xlink_list *bytes) {
  int i;
  for (i = index + 1; i <= bin->nsegments; i++) {
    xlink_segment *seg;
    seg = xlink_binary_get_segment(bin, i);
    if (xlink_segment_get_class(seg) != class) break;
    XLINK_ERROR(seg->info & SEG_HAS_DATA == 0,
     ("Error segment %s has no data", xlink_segment_get_name(seg)));
    if (offset != seg->start) {
      unsigned char buf[4096];
      memset(buf, 0, 4096);
      xlink_list_add_all(bytes, buf, seg->start - offset);
      offset = seg->start;
    }
    xlink_list_add_all(bytes, seg->data, seg->length);
    offset += seg->length;
  }
  return offset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %r8, %r12
movl %ecx, %ebp
movl %edx, (%rsp)
movl %esi, %r14d
leaq 0x4add(%rip), %r15      # 0xad68
movl %ecx, 0x4(%rsp)
movq %rdi, 0x8(%rsp)
cmpl 0x50(%rdi), %r14d
jge 0x6341
incl %r14d
movl %r14d, %esi
callq 0x378b
movq %rax, %r13
movq 0x28(%rax), %rdi
addq $0x10, %rdi
movq %r15, %rsi
callq 0x2100
testl %eax, %eax
je 0x62d0
movl 0x30(%r13), %eax
andl $0x1, %eax
movl $0x2, %ebx
subl %eax, %ebx
jmp 0x62d2
xorl %ebx, %ebx
cmpl %ebp, %ebx
jne 0x6334
movl (%rsp), %r15d
cmpl 0x7c(%r13), %r15d
jne 0x62e5
movq %r12, %rbp
jmp 0x6311
movl $0x1000, %edx           # imm = 0x1000
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x20d0
movl 0x7c(%r13), %edx
subl %r15d, %edx
movq %r12, %rbp
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x941a
movl 0x7c(%r13), %r15d
movq 0x38(%r13), %rsi
movl 0x1c(%r13), %edx
movq %rbp, %rdi
callq 0x941a
addl 0x1c(%r13), %r15d
movl %r15d, (%rsp)
movl 0x4(%rsp), %ebp
leaq 0x4a34(%rip), %r15      # 0xad68
cmpl %ebp, %ebx
movq 0x8(%rsp), %rdi
je 0x6294
movl (%rsp), %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_model_search
void xlink_model_search(xlink_list *models, xlink_list *bytes) {
  xlink_modeler mod;
  /* Build a context modeler for bytes */
  xlink_modeler_init(&mod, xlink_list_length(bytes));
  xlink_modeler_load_binary(&mod, bytes);
  /* Search for the best context to use for bytes */
  xlink_list_empty(models);
  xlink_modeler_search(&mod, models);
  XLINK_ERROR(xlink_list_length(models) == 0,
   ("Error no context models found for bytes"));
  xlink_modeler_clear(&mod);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x931a
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl %eax, %esi
callq 0x8b7f
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8bfc
movq %r14, %rdi
callq 0x931e
movq %r15, %rdi
movq %r14, %rsi
callq 0x90c9
movq %r14, %rdi
callq 0x931a
testl %eax, %eax
je 0x63c0
leaq 0x8(%rsp), %rdi
callq 0x8bdd
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x49cc(%rip), %rdi      # 0xad93
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_decoder_test_bytes
void xlink_decoder_test_bytes(xlink_decoder *dec, xlink_list *bytes) {
  int i;
  for (i = 0; i < xlink_list_length(bytes); i++) {
    unsigned char orig;
    unsigned char byte;
    orig = *xlink_list_get_byte(bytes, i);
    byte = xlink_decoder_read_byte(dec);
    XLINK_ERROR(byte != orig,
     ("Decoder mismatch %02x != %02x at pos = %i", byte, orig, i));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x931a
testl %eax, %eax
jle 0x646c
xorl %ebp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x9366
movzbl (%rax), %r15d
movq %r14, %rdi
callq 0x847a
cmpb %r15b, %al
jne 0x6477
incl %ebp
movq %rbx, %rdi
callq 0x931a
cmpl %eax, %ebp
jl 0x6443
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movzbl %al, %esi
leaq 0x493a(%rip), %rdi      # 0xadbb
movl %r15d, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_bitstream_from_context
void xlink_bitstream_from_context(xlink_bitstream *bs, xlink_context *ctx,
 xlink_list *bytes) {
  xlink_encoder enc;
  xlink_decoder dec;
  bs->bytes.length = 0;
  /* Reset the context */
  xlink_context_reset(ctx);
  /* Encode bytes with the context */
  xlink_encoder_init(&enc, ctx);
  xlink_encoder_write_bytes(&enc, bytes);
  /* Finalize the bitstream */
  xlink_encoder_finalize(&enc, bs);
  xlink_encoder_clear(&enc);
  /* Reset the context */
  xlink_context_reset(ctx);
  /* Initialize the decoder with the context and bitstream */
  xlink_decoder_init(&dec, ctx, bs);
  /* Test that decoded bytes match original input */
  xlink_decoder_test_bytes(&dec, bytes);
  xlink_decoder_clear(&dec);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x0, 0x10(%rdi)
movq %rsi, %rdi
callq 0x89e6
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x7ef6
movq %r12, %rdi
movq %rbx, %rsi
callq 0x7fe4
movq %r12, %rdi
movq %r14, %rsi
callq 0x80f4
movq %r12, %rdi
callq 0x7fdb
movq %r15, %rdi
callq 0x89e6
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x833a
movq %r12, %rdi
movq %rbx, %rsi
callq 0x6428
movq %r12, %rdi
callq 0x8479
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_binary_load_modules
void xlink_binary_load_modules(xlink_binary *bin) {
  int i;
  for (i = 0; i < sizeof(XLINK_STUB_MODULES)/sizeof(xlink_file); i++) {
    xlink_file file;
    file = XLINK_STUB_MODULES[i];
    if (strstr(file.name, "stub32") == NULL) {
      xlink_module *mod;
      mod = xlink_file_load_omf_module(&file, 0);
      XLINK_LIST_ADD(binary, module, bin, mod);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorl %r13d, %r13d
leaq 0x91b5(%rip), %rbp      # 0xf850
leaq 0x4743(%rip), %r14      # 0xade5
movq %rsp, %r15
movups (%r13,%rbp), %xmm0
movaps %xmm0, (%rsp)
movq 0x10(%r13,%rbp), %rax
movq %rax, 0x10(%rsp)
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x2230
testq %rax, %rax
jne 0x670f
movq %r15, %rdi
xorl %esi, %esi
callq 0x4c64
movq %rax, %r12
movl 0x30(%rbx), %eax
incl %eax
movl %eax, 0x8(%r12)
movq %rbx, 0x10(%r12)
movslq 0x30(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x30(%rbx)
movq 0x28(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x852c
movq %rax, 0x28(%rbx)
movslq 0x30(%rbx), %rcx
movq %r12, -0x8(%rax,%rcx,8)
addq $0x18, %r13
cmpq $0x270, %r13            # imm = 0x270
jne 0x66a5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_binary_load_stub
void xlink_binary_load_stub(xlink_binary *bin, const char *stub) {
  char buf[1024];
  xlink_module *mod;
  int i;
  sprintf(buf, "stubs/%s.o", stub);
  mod = NULL;
  for (i = 0; i < sizeof(XLINK_STUB_MODULES)/sizeof(xlink_file); i++) {
    xlink_file file;
    file = XLINK_STUB_MODULES[i];
    if (strcmp(file.name, buf) == 0) {
      mod = xlink_file_load_omf_module(&file, 0);
      XLINK_LIST_ADD(binary, module, bin, mod);
      break;
    }
  }
  XLINK_ERROR(mod == NULL, ("Stub %s not found", stub));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movq %rsi, %rdx
movq %rdi, %r14
leaq 0x46a3(%rip), %rsi      # 0xadec
xorl %ebx, %ebx
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %rdx, 0x8(%rsp)
xorl %eax, %eax
callq 0x21e0
leaq 0x90ea(%rip), %r12      # 0xf850
xorl %r13d, %r13d
movups (%rbx,%r12), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x10(%rbx,%r12), %rax
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x2100
movl %eax, %ebp
testl %eax, %eax
jne 0x67d7
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x4c64
movq %rax, %r13
movl 0x30(%r14), %eax
incl %eax
movl %eax, 0x8(%r13)
movq %r14, 0x10(%r13)
movslq 0x30(%r14), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x30(%r14)
movq 0x28(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x852c
movq %rax, 0x28(%r14)
movslq 0x30(%r14), %rcx
movq %r13, -0x8(%rax,%rcx,8)
testl %ebp, %ebp
je 0x67ef
leaq 0x18(%rbx), %rax
cmpq $0x258, %rbx            # imm = 0x258
movq %rax, %rbx
jne 0x6769
testq %r13, %r13
je 0x6806
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x45ea(%rip), %rdi      # 0xadf7
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_binary_find_segment_by_public
xlink_segment *xlink_binary_find_segment_by_public(xlink_binary *bin,
 const char *public, xlink_segment_class class) {
  xlink_segment *seg;
  seg = xlink_binary_find_public(bin, public)->segment;
  XLINK_ERROR(xlink_segment_get_class(seg) != class,
   ("Public %s found in segment %s, but class %s not '%s'", public,
   xlink_segment_get_name(seg), xlink_segment_get_class_name(seg),
   XLINK_SEGMENT_CLASS_NAME[class]));
  return seg;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
callq 0x359a
movq 0x18(%rax), %r14
movq 0x28(%r14), %rdi
addq $0x10, %rdi
leaq 0x4524(%rip), %rsi      # 0xad68
callq 0x2100
testl %eax, %eax
je 0x685d
movl 0x30(%r14), %ecx
andl $0x1, %ecx
movl $0x2, %eax
subl %ecx, %eax
jmp 0x685f
xorl %eax, %eax
cmpl %ebp, %eax
jne 0x686b
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rdi
callq 0x26fc
movq %r14, %rdi
callq 0x2724
movl %ebp, %eax
leaq 0x38e4(%rip), %rcx      # 0xa168
movslq (%rcx,%rax,4), %r8
addq %rcx, %r8
leaq 0x4577(%rip), %rdi      # 0xae09
leaq 0xc797(%rip), %rdx      # 0x13030
leaq 0xc890(%rip), %rcx      # 0x13130
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_binary_write_map
void xlink_binary_write_map(xlink_binary *bin) {
  FILE *out;
  out = fopen(bin->map, "w");
  xlink_binary_print_map(bin, out);
  fclose(out);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
leaq 0x4a29(%rip), %rsi      # 0xb2ef
callq 0x21b0
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3995
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2090
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_binary_write_com
void xlink_binary_write_com(xlink_binary *bin, int nsegments) {
  FILE *out;
  int i;
  int offset;
  out = fopen(bin->output, "wb");
  XLINK_ERROR(out == NULL, ("Unable to open output file '%s'", bin->output));
  for (offset = 0x100, i = 1; i <= nsegments; i++) {
    xlink_segment *seg;
    seg = xlink_binary_get_segment(bin, i);
    if (seg->info & SEG_HAS_DATA) {
      if (offset != seg->start) {
        unsigned char buf[4096];
        memset(buf, 0, 4096);
        fwrite(buf, 1, seg->start - offset, out);
        offset = seg->start;
      }
      fwrite(seg->data, 1, seg->length, out);
      offset += seg->length;
    }
  }
  fclose(out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movl %esi, %r14d
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0x4535(%rip), %rsi      # 0xae3e
callq 0x21b0
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x69c7
testl %r14d, %r14d
jle 0x69ac
negl %r14d
movl $0x100, %r12d           # imm = 0x100
movl $0x1, %r13d
movq %rbx, %rdi
movl %r13d, %esi
callq 0x378b
testb $0x1, 0x30(%rax)
je 0x6999
movq %rax, %rbp
movl 0x7c(%rax), %r15d
subl %r12d, %r15d
je 0x697e
movl $0x1000, %edx           # imm = 0x1000
leaq 0x10(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x20d0
movslq %r15d, %rdx
movl $0x1, %esi
movq %r12, %rdi
movq 0x8(%rsp), %rcx
callq 0x2200
movl 0x7c(%rbp), %r12d
movq 0x38(%rbp), %rdi
movslq 0x1c(%rbp), %rdx
movl $0x1, %esi
movq 0x8(%rsp), %rcx
callq 0x2200
addl 0x1c(%rbp), %r12d
leal (%r14,%r13), %eax
incl %eax
movl %r13d, %ecx
incl %ecx
movl %ecx, %r13d
cmpl $0x1, %eax
jne 0x6934
movq 0x8(%rsp), %rdi
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2090
movq (%rbx), %rsi
leaq 0x4470(%rip), %rdi      # 0xae41
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/xlink.c
// Function: xlink_segment_find_reloc
xlink_reloc *xlink_segment_find_reloc(xlink_segment *seg, const char *name) {
  xlink_reloc *ret;
  int i;
  ret = NULL;
  for (i = 1; i <= seg->nrelocs; i++) {
    xlink_reloc *rel;
    rel = xlink_segment_get_reloc(seg, i);
    if (rel->target == OMF_TARGET_EXT) {
      xlink_extern *ext;
      ext = xlink_module_get_extern(seg->module, rel->target_idx);
      if (strcmp(ext->name, name) == 0) {
        XLINK_ERROR(ret != NULL,
         ("Duplicate relocation definition found for name %s in %s", name,
         seg->module->filename));
        ret = rel;
        break;
      }
    }
  }
  XLINK_ERROR(ret == NULL, ("No relocation found for extern name %s", name));
  return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
xorl %r12d, %r12d
cmpl $0x0, 0x78(%rdi)
jle 0x6a4b
movq %rdi, %r15
xorl %r14d, %r14d
incl %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x2650
movq %rax, %r13
movb $0x1, %al
cmpl $0x6, 0x28(%r13)
jne 0x6a3f
movq 0x8(%r15), %rdi
movl 0x30(%r13), %esi
callq 0x3106
leaq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x2100
testl %eax, %eax
setne %al
jne 0x6a3f
testq %r14, %r14
movq %r13, %r14
jne 0x6a60
testb %al, %al
je 0x6a4e
cmpl 0x78(%r15), %r12d
jl 0x69fd
jmp 0x6a4e
xorl %r14d, %r14d
testq %r14, %r14
je 0x6a7a
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8(%r15), %rax
movq (%rax), %rdx
leaq 0x43f3(%rip), %rdi      # 0xae61
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22ef
jmp 0x6a8b
leaq 0x4418(%rip), %rdi      # 0xae99
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0