LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/developer_cmds/what/what.c
// Function: search
void
search()
{
	int c;

	while ((c = getchar()) != EOF) {
loop:		if (c != '@')
			continue;
		if ((c = getchar()) != '(')
			goto loop;
		if ((c = getchar()) != '#')
			goto loop;
		if ((c = getchar()) != ')')
			goto loop;
		putchar('\t');
		while ((c = getchar()) != EOF && c && c != '"' &&
		    c != '>' && c != '\n')
			putchar(c);
		putchar('\n');
	}
}

// Assembly:
pushq %rbx
callq 0x1060
cmpl $-0x1, %eax
je 0x1262
movabsq $-0x7ffffff7fffff7fd, %rbx # imm = 0x8000000800000803
cmpl $0x40, %eax
jne 0x1258
callq 0x1060
cmpl $0x28, %eax
jne 0x120b
callq 0x1060
cmpl $0x23, %eax
jne 0x120b
callq 0x1060
cmpl $0x29, %eax
jne 0x120b
movl $0x9, %eax
movl %eax, %edi
callq 0x1030
callq 0x1060
movl %eax, %ecx
incl %ecx
cmpl $0x3f, %ecx
ja 0x1233
btq %rcx, %rbx
jae 0x1233
movl $0xa, %edi
callq 0x1030
callq 0x1060
cmpl $-0x1, %eax
jne 0x120b
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/DeforaOS[P]libSystem/tools/configctl.c
// Function: configctl_print
static void _configctl_print(int verbose, char const * section,
		char const * variable, char const * value)
{
	if(verbose < 0)
		return;
	printf("%s%s%s%s%s\n", (verbose > 0 && section != NULL) ? section : "",
			(verbose > 0 && section != NULL && section[0] != '\0')
			? "." : "",
			(verbose > 0) ? variable : "",
			(verbose > 0) ? "=" : "",
			(value != NULL) ? value : "");
}

// Assembly:
testl %edi, %edi
js 0x15e2
movq %rcx, %r9
movq %rdx, %rcx
movq %rsi, %rax
setne %r8b
testq %rsi, %rsi
setne %r11b
leaq 0xba7(%rip), %r10       # 0x213f
movq %r10, %rsi
movq %r10, %rdx
testb %r11b, %r8b
cmovneq %rax, %rsi
je 0x15bc
cmpb $0x0, (%rax)
leaq 0xb8e(%rip), %rax       # 0x213f
leaq 0xb88(%rip), %rdx       # 0x2140
cmoveq %rax, %rdx
testl %edi, %edi
cmoveq %r10, %rcx
leaq 0xb79(%rip), %r8        # 0x2142
cmoveq %r10, %r8
testq %r9, %r9
cmoveq %r10, %r9
leaq 0xb59(%rip), %rdi       # 0x2134
xorl %eax, %eax
jmp 0x1060
retq
// File: /workspace/github_c_makefile_star2_O3/smilingthax[P]libfontembed/test_analyze.c
// Function: show_post
void show_post(OTF_FILE *otf) // {{{
{
  assert(otf);
  int len=0;
  char *buf;

  buf=otf_get_table(otf,OTF_TAG('p','o','s','t'),&len);
  if (!buf) {
    assert(len==-1);
    printf("No post table\n");
    return;
  }
  // TODO: check len
  printf("POST: (%d bytes)\n"
         "  version: %08x\n"
         "  italicAngle: %d.%d\n"
         "  underlinePosition: %d\n"
         "  underlineThickness: %d\n"
         "  isFixedPitch: %d\n"
         "  vmType42: %d %d\n"
         "  vmType1: %d %d\n",len,
         get_ULONG(buf),
         get_LONG(buf+4)>>16,get_ULONG(buf+4)&0xffff,
         get_SHORT(buf+8),
         get_SHORT(buf+10),
         get_ULONG(buf+12),
         get_ULONG(buf+16),get_ULONG(buf+20),
         get_ULONG(buf+24),get_ULONG(buf+38));
  free(buf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x1f7b
leaq 0xc(%rsp), %r14
movl $0x0, (%r14)
movl $0x706f7374, %esi       # imm = 0x706F7374
movq %r14, %rdx
callq 0x3314
movl (%r14), %esi
testq %rax, %rax
je 0x1f5c
movq %rax, %rbx
movl (%rax), %edx
bswapl %edx
movzbl 0x4(%rax), %eax
shll $0x18, %eax
movzbl 0x5(%rbx), %ecx
shll $0x10, %ecx
orl %eax, %ecx
sarl $0x10, %ecx
movzwl 0x6(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %r8d
movzbl 0x9(%rbx), %eax
movzbl 0x8(%rbx), %edi
shll $0x8, %edi
movswl %di, %r9d
orl %eax, %r9d
movzbl 0xb(%rbx), %eax
movzbl 0xa(%rbx), %edi
shll $0x8, %edi
movswl %di, %r10d
orl %eax, %r10d
movl 0xc(%rbx), %r11d
bswapl %r11d
movl 0x10(%rbx), %r14d
bswapl %r14d
movl 0x14(%rbx), %r15d
bswapl %r15d
movl 0x18(%rbx), %r12d
bswapl %r12d
movl 0x26(%rbx), %r13d
bswapl %r13d
leaq 0x70ff(%rip), %rdi      # 0x903a
xorl %eax, %eax
pushq %r13
pushq %r12
pushq %r15
pushq %r14
pushq %r11
pushq %r10
callq 0x1040
addq $0x30, %rsp
movq %rbx, %rdi
callq 0x1190
jmp 0x1f6d
cmpl $-0x1, %esi
jne 0x1f9a
leaq 0x750f(%rip), %rdi      # 0x9477
callq 0x11f0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x7082(%rip), %rdi      # 0x9004
leaq 0x707f(%rip), %rsi      # 0x9008
leaq 0x7087(%rip), %rcx      # 0x9017
movl $0x19, %edx
callq 0x10e0
leaq 0x7091(%rip), %rdi      # 0x9032
leaq 0x7060(%rip), %rsi      # 0x9008
leaq 0x7068(%rip), %rcx      # 0x9017
movl $0x1f, %edx
callq 0x10e0
// File: /workspace/github_c_makefile_star2_O3/smilingthax[P]libfontembed/test_analyze.c
// Function: show_glyf
void show_glyf(OTF_FILE *otf,int full) // {{{
{
  assert(otf);

  // ensure >glyphOffsets and >gly is there
  if ( (!otf->gly)||(!otf->glyphOffsets) ) {
    if (otf_load_glyf(otf)!=0) {
      assert(0);
      return;
    }
  }

  int iA;
  int compGlyf=0,zeroGlyf=0;

  // {{{ glyf
  assert(otf->gly);
  for (iA=0;iA<otf->numGlyphs;iA++) {
    int len=otf_get_glyph(otf,iA);
    if (len==0) {
      zeroGlyf++;
    } else if (get_SHORT(otf->gly)==-1) {
      compGlyf++;
    }
    if (full) {
      printf("%d(%d) ",get_SHORT(otf->gly),len);
    }
  }
  if (full) {
    printf("\n");
  }
  printf("numGlyf(nonnull): %d(%d), composites: %d\n",otf->numGlyphs,otf->numGlyphs-zeroGlyf,compGlyf);
  // }}}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2624
movl %esi, %ebp
movq %rdi, %rbx
cmpq $0x0, 0x80(%rdi)
je 0x254e
cmpq $0x0, 0x50(%rbx)
jne 0x256c
movq %rbx, %rdi
callq 0x3408
testl %eax, %eax
jne 0x2643
cmpq $0x0, 0x80(%rbx)
je 0x2662
cmpw $0x0, 0x4c(%rbx)
je 0x25e3
leaq 0x6d81(%rip), %r15      # 0x92fb
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %r14d, %r14d
movzwl %r13w, %esi
movq %rbx, %rdi
callq 0x3ba8
testl %eax, %eax
je 0x25ac
movq 0x80(%rbx), %rcx
movb (%rcx), %dl
andb 0x1(%rcx), %dl
xorl %ecx, %ecx
cmpb $-0x1, %dl
sete %cl
addl %ecx, %r14d
jmp 0x25af
incl %r12d
testl %ebp, %ebp
je 0x25d5
movq 0x80(%rbx), %rcx
movzbl 0x1(%rcx), %edx
movzbl (%rcx), %ecx
shll $0x8, %ecx
movswl %cx, %esi
orl %edx, %esi
movq %r15, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x1040
incl %r13d
movzwl 0x4c(%rbx), %eax
cmpl %eax, %r13d
jb 0x2583
jmp 0x25eb
xorl %eax, %eax
xorl %r14d, %r14d
xorl %r12d, %r12d
testl %ebp, %ebp
je 0x25fd
movl $0xa, %edi
callq 0x11c0
movzwl 0x4c(%rbx), %eax
movzwl %ax, %esi
movl %esi, %edx
subl %r12d, %edx
leaq 0x6cf7(%rip), %rdi      # 0x9303
movl %r14d, %ecx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1040
leaq 0x69d9(%rip), %rdi      # 0x9004
leaq 0x69d6(%rip), %rsi      # 0x9008
leaq 0x6c99(%rip), %rcx      # 0x92d2
movl $0xa8, %edx
callq 0x10e0
leaq 0x6eb1(%rip), %rdi      # 0x94fb
leaq 0x69b7(%rip), %rsi      # 0x9008
leaq 0x6c7a(%rip), %rcx      # 0x92d2
movl $0xad, %edx
callq 0x10e0
leaq 0x6c89(%rip), %rdi      # 0x92f2
leaq 0x6998(%rip), %rsi      # 0x9008
leaq 0x6c5b(%rip), %rcx      # 0x92d2
movl $0xb6, %edx
callq 0x10e0
// File: /workspace/github_c_makefile_star2_O3/smilingthax[P]libfontembed/test_analyze.c
// Function: show_hmtx
void show_hmtx(OTF_FILE *otf) // {{{
{
  assert(otf);
  int iA;

  otf_get_width(otf,0); // load table.
  if (!otf->hmtx) {
    printf("NOTE: no hmtx table!\n");
    return;
  }
  printf("hmtx (%d):\n",otf->numberOfHMetrics);
  for (iA=0;iA<otf->numberOfHMetrics;iA++) {
    printf("(%d,%d) ",
           get_USHORT(otf->hmtx+iA*4),
           get_SHORT(otf->hmtx+iA*4+2));
  }
  printf(" (last is repeated for the remaining %d glyphs)\n",otf->numGlyphs-otf->numberOfHMetrics);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x273b
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x39a6
cmpq $0x0, 0x60(%rbx)
je 0x2724
movzwl 0x58(%rbx), %esi
leaq 0x6c97(%rip), %rdi      # 0x9348
xorl %eax, %eax
callq 0x1040
cmpw $0x0, 0x58(%rbx)
je 0x2704
leaq 0x6c8e(%rip), %r14      # 0x9354
xorl %r12d, %r12d
movq 0x60(%rbx), %rax
movzwl (%rax,%r12,4), %ecx
rolw $0x8, %cx
movzwl %cx, %esi
movzbl 0x3(%rax,%r12,4), %ecx
movzbl 0x2(%rax,%r12,4), %eax
shll $0x8, %eax
movswl %ax, %edx
orl %ecx, %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1040
incq %r12
movzwl 0x58(%rbx), %r15d
cmpq %r15, %r12
jb 0x26c9
movzwl 0x4c(%rbx), %esi
subl %r15d, %esi
leaq 0x6c4b(%rip), %rdi      # 0x935d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1040
leaq 0x6d85(%rip), %rdi      # 0x94b0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x11f0
leaq 0x68c2(%rip), %rdi      # 0x9004
leaq 0x68bf(%rip), %rsi      # 0x9008
leaq 0x6bdd(%rip), %rcx      # 0x932d
movl $0xcc, %edx
callq 0x10e0
// File: /workspace/github_c_makefile_star2_O3/shuffle2[P]nx2elf/nx2elf.cpp
// Function: main
int main(int argc, char** argv) {
  if (argc < 2 || !fs::exists(argv[1])) {
    fputs("file or directory", stderr);
    return 1;
  }

  fs::path path(argv[1]);
  if (fs::is_directory(path)) {
    File::iter_files(path, [](const fs::path& nx_path) { NsoToElf(nx_path); });
  } else {
    NsoToElf(path);
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
cmpl $0x2, %edi
jl 0xbccf
movq %rsi, %rbx
addq $0x8, %rbx
leaq -0x88(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0xc00c
movq %r14, %rdi
callq 0x20b0
movq %rax, %r14
leaq -0x88(%rbp), %rdi
callq 0xc094
cmpb $-0x1, %r14b
je 0xbccf
movzbl %r14b, %eax
testl %eax, %eax
je 0xbccf
leaq -0x88(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0xc00c
movq %r14, %rdi
callq 0x20b0
cmpb $0x2, %al
jne 0xbcbe
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
leaq 0x37a(%rip), %rax       # 0xbfe0
movq %rax, -0x48(%rbp)
leaq 0x37d(%rip), %rax       # 0xbfee
movq %rax, -0x50(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x88(%rbp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2110
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
testq %rax, %rax
je 0xbcde
movq 0xd333(%rip), %rdx      # 0x18fd0
cmpb $0x0, (%rdx)
je 0xbd6c
incl 0x8(%rax)
movq %rcx, -0x28(%rbp)
movq %rax, -0x20(%rbp)
movq %rax, %rdi
incl 0x8(%rax)
callq 0xc0ea
jmp 0xbcea
leaq -0x88(%rbp), %rdi
callq 0xbe04
jmp 0xbd53
callq 0x22e0
movl $0x1, %eax
jmp 0xbd61
movq %rcx, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
leaq -0x28(%rbp), %rbx
leaq -0x60(%rbp), %r14
cmpq $0x0, -0x20(%rbp)
je 0xbd2e
movq %rbx, %rdi
callq 0x22a0
movq %rax, %r15
movq %rax, %rdi
callq 0x20b0
cmpb $0x2, %al
je 0xbd24
cmpq $0x0, -0x50(%rbp)
je 0xbd9b
movq %r14, %rdi
movq %r15, %rsi
callq *-0x48(%rbp)
movq %rbx, %rdi
callq 0x2080
jmp 0xbcf2
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0xbd3c
callq 0xc0ea
movq -0x50(%rbp), %rax
testq %rax, %rax
je 0xbd53
leaq -0x60(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq -0x88(%rbp), %rdi
callq 0xc094
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
lock
incl 0x8(%rax)
movq -0x30(%rbp), %rdi
movq %rcx, -0x28(%rbp)
movq %rax, -0x20(%rbp)
testq %rdi, %rdi
je 0xbcea
cmpb $0x0, (%rdx)
je 0xbd92
movq %rdi, %rax
jmp 0xbcb4
lock
incl 0x8(%rdi)
jmp 0xbcb7
callq 0x20a0
jmp 0xbdfc
movq %rax, %rbx
jmp 0xbdd1
jmp 0xbda9
movq %rax, %rbx
jmp 0xbde8
jmp 0xbdb2
jmp 0xbdb2
movq %rax, %rbx
movq -0x20(%rbp), %rdi
testq %rdi, %rdi
je 0xbdc3
callq 0xc0ea
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0xbdd1
callq 0xc0ea
movq -0x50(%rbp), %rax
testq %rax, %rax
je 0xbde8
leaq -0x60(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq -0x88(%rbp), %rdi
callq 0xc094
movq %rbx, %rdi
callq 0x2280
movq %rax, %rdi
callq 0xc0db
// File: /workspace/github_c_makefile_star2_O3/shuffle2[P]nx2elf/nx2elf.cpp
// Function: NsoToElf(std::filesystem::__cxx11::path const&, bool)
static bool NsoToElf(const fs::path& path, bool verbose = false) {
  NsoFile nso;
  if (!nso.Load(path)) {
    return false;
  }
  printf("%s:\n", path.string().c_str());
  nso.Dump(verbose);
  if (verbose) {
    nso.DumpElfInfo();
  }
  fs::path elf_path(path);
  elf_path.replace_extension(".elf");
  bool rv = nso.WriteElf(elf_path);
  puts("");
  return rv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rdi, %rbx
leaq -0x140(%rbp), %r14
leaq -0x248(%rbp), %r15
movl $0x104, %edx            # imm = 0x104
movq %r15, %rdi
xorl %esi, %esi
callq 0x20f0
movl $0xa8, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x20f0
xorps %xmm0, %xmm0
movups %xmm0, 0x1c0(%r15)
movups %xmm0, 0x1d0(%r15)
movq %r15, %rdi
movq %rbx, %rsi
callq 0xc156
testb %al, %al
je 0xbf13
movq (%rbx), %rsi
leaq -0x30(%rbp), %r14
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %r14, -0x10(%r14)
leaq -0x40(%rbp), %rdi
callq 0xfcf8
movq -0x40(%rbp), %rsi
leaq 0x929b(%rip), %rdi      # 0x1512a
xorl %eax, %eax
callq 0x2030
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0xbeab
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0x248(%rbp), %rdi
xorl %esi, %esi
callq 0xcbf0
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
callq 0xcf02
leaq 0x9263(%rip), %rsi      # 0x1512f
leaq -0x68(%rbp), %rdi
movl $0x2, %edx
callq 0xcf62
leaq -0x40(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x2170
leaq -0x68(%rbp), %rdi
callq 0xc094
leaq -0x248(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xcfea
movl $0xa, %edi
callq 0x2220
leaq -0x40(%rbp), %rdi
callq 0xc094
movq -0x140(%rbp), %rdi
testq %rdi, %rdi
je 0xbf2e
movq -0x130(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbf4c
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0xc094
jmp 0xbf4f
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xc094
jmp 0xbf61
jmp 0xbf5e
jmp 0xbf5e
movq %rax, %rbx
movq -0x140(%rbp), %rdi
testq %rdi, %rdi
je 0xbf7c
movq -0x130(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_c_makefile_star2_O3/shuffle2[P]nx2elf/nx2elf.cpp
// Function: NsoFile::Decompress(unsigned char*, unsigned int, unsigned char const*, unsigned int)
bool Decompress(u8* dst, u32 dst_len, const u8* src, u32 src_len) {
    int len =
        LZ4_decompress_safe(reinterpret_cast<const char*>(src),
                            reinterpret_cast<char*>(dst), src_len, dst_len);
    if (len != dst_len)
      printf("LZ4_decompress_safe: %d (expected %8x)\n", len, dst_len);
    return len > 0;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rcx, %rdi
movl %r8d, %edx
movl %ebx, %ecx
callq 0x8983
movl %eax, %r14d
cmpl %ebx, %eax
je 0xf5f0
leaq 0x5c49(%rip), %rdi      # 0x1522d
movl %r14d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2030
testl %r14d, %r14d
setg %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/shuffle2[P]nx2elf/nx2elf.cpp
// Function: NsoFile::ResolvePlt(void*, unsigned long)
bool ResolvePlt(void* base, size_t len) {
    // Each plt slot is 4 instructions. The first entry fills 2 slots (resolving
    // thunk).
    if (dyn_info.pltrelsz) {
      const u32 plt_pattern[]{0xa9bf7bf0, 0xd00004d0, 0xf9428a11, 0x91144210,
                              0xd61f0220, 0xd503201f, 0xd503201f, 0xd503201f};
      const u32 plt_mask[ARRAY_SIZE(plt_pattern)]{
          0xffffffff, 0x00000000, 0xff000000, 0xff000000,
          0xff000000, 0xffffffff, 0xffffffff, 0xffffffff};
      auto found = static_cast<u8*>(
          memmem_m(base, len, plt_pattern, plt_mask, sizeof(plt_pattern)));
      if (found) {
        plt_info.addr = found - &image[0];
        // Assume the plt exactly matches .rela.plt
        u64 plt_entry_count = dyn_info.pltrelsz / sizeof(Elf64_Rela);
        const u64 plt_entry_size = sizeof(u32) * 4;
        plt_info.size = plt_entry_size * 2 + plt_entry_size * plt_entry_count;
        return true;
      }
    }
    return false;
  }

// Assembly:
movq 0x150(%rdi), %rax
testq %rax, %rax
je 0xf615
leaq (%rsi,%rdx), %rcx
addq $-0x20, %rcx
cmpq %rsi, %rcx
jae 0xf618
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x610d(%rip), %rdx      # 0x15730
leaq 0x60e6(%rip), %r8       # 0x15710
xorl %r9d, %r9d
movb (%r9,%r8), %r10b
xorb (%rsi,%r9), %r10b
andb (%r9,%rdx), %r10b
cmpq $0x1f, %r9
je 0xf647
incq %r9
testb %r10b, %r10b
je 0xf62d
testb %r10b, %r10b
je 0xf656
incq %rsi
cmpq %rcx, %rsi
jbe 0xf62a
jmp 0xf689
testq %rsi, %rsi
je 0xf689
subq 0x108(%rdi), %rsi
movq %rsi, 0x1b0(%rdi)
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
andq $-0x10, %rdx
addq $0x20, %rdx
movq %rdx, 0x1b8(%rdi)
movb $0x1, %al
jmp 0xf68b
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/shuffle2[P]nx2elf/nx2elf.cpp
// Function: StringTable::GetBuffer()
std::vector<char> GetBuffer() {
    std::vector<char> buffer(watermark);
    for (const auto& entry : entries) {
      strcpy(&buffer[entry.second], entry.first);
    }
    return buffer;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x38(%rsi), %esi
leaq -0x11(%rbp), %rdx
callq 0x1097e
movq 0x10(%r14), %r14
testq %r14, %r14
je 0x10971
movl 0x10(%r14), %edi
addq (%rbx), %rdi
movq 0x8(%r14), %rsi
callq 0x2180
movq (%r14), %r14
jmp 0x10957
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/shuffle2[P]nx2elf/lz4.c
// Function: LZ4_decompress_safe_usingDict
int LZ4_decompress_safe_usingDict(const char* source, char* dest, int compressedSize, int maxOutputSize, const char* dictStart, int dictSize)
{
    if (dictSize==0)
        return LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize);
    if (dictStart+dictSize == dest) {
        if (dictSize >= 64 KB - 1) {
            return LZ4_decompress_safe_withPrefix64k(source, dest, compressedSize, maxOutputSize);
        }
        assert(dictSize >= 0);
        return LZ4_decompress_safe_withSmallPrefix(source, dest, compressedSize, maxOutputSize, (size_t)dictSize);
    }
    assert(dictSize >= 0);
    return LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize, dictStart, (size_t)dictSize);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %r9d, %r9d
jne 0x13f96
popq %rbp
jmp 0x8983
movl %r9d, %eax
movslq %r9d, %r9
leaq (%r8,%r9), %r10
cmpq %rsi, %r10
jne 0x13fb2
cmpl $0xffff, %eax           # imm = 0xFFFF
jl 0x13fb8
popq %rbp
jmp 0x969a
popq %rbp
jmp 0x9d25
movq %r9, %r8
popq %rbp
jmp 0xae90
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/sam.c
// Function: fail
static void HTS_FORMAT(HTS_PRINTF_FMT, 1, 2) fail(const char *fmt, ...)
{
    va_list args;

    fprintf(stderr, "Failed: ");
    va_start(args, fmt);
    vfprintf(stderr, fmt, args);
    va_end(args);
    fprintf(stderr, "\n");

    status = EXIT_FAILURE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x4a43
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0xb6596(%rip), %r15     # 0xbafe0
movq (%r15), %rcx
leaq 0x9070d(%rip), %rdi     # 0x95161
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x49a0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movq %r14, 0x10(%rdx)
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x4690
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x4630
movl $0x1, 0xb6aa5(%rip)     # 0xbb544
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/sam.c
// Function: check_bam_aux_get
uint8_t *check_bam_aux_get(const bam1_t *aln, const char *tag, char type)
{
    uint8_t *p = bam_aux_get(aln, tag);
    if (p) {
        if (*p == type) return p;
        else fail("%s field of type '%c', expected '%c'", tag, *p, type);
    }
    else fail("can't find %s field", tag);

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
callq 0x313f1
testq %rax, %rax
je 0x6025
movq %rax, %rbx
movzbl (%rax), %edx
movsbl %bpl, %ecx
cmpl %ecx, %edx
jne 0x603a
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8f0e1(%rip), %rdi     # 0x9510d
xorl %ebx, %ebx
movq %r14, %rsi
xorl %eax, %eax
callq 0x49e0
jmp 0x601d
leaq 0x8f0a7(%rip), %rdi     # 0x950e8
xorl %ebx, %ebx
movq %r14, %rsi
xorl %eax, %eax
callq 0x49e0
jmp 0x601d
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/sam.c
// Function: test_text_file
static void test_text_file(const char *filename, int nexp)
{
    htsFile *in = hts_open(filename, "r");
    if (in) {
        kstring_t str = KS_INITIALIZE;
        int ret, n = 0;
        while ((ret = hts_getline(in, '\n', &str)) >= 0) {
            size_t len = strlen(str.s);
            n++;
            if (ret != len) fail("hts_getline read length %d (expected %zu)", ret, len);
        }
        if (ret != -1) fail("hts_getline got an error from %s", filename);
        if (n != nexp) fail("hts_getline read %d lines from %s (expected %d)", n, filename, nexp);

        hts_close(in);
        free(str.s);
    }
    else fail("can't open %s to read as text", filename);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x926e8(%rip), %rsi     # 0x9d73f
callq 0x1b1e0
testq %rax, %rax
je 0xb106
movq %rax, %r14
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
movq %rax, %rdi
movl $0xa, %esi
callq 0x1ca2a
movl %eax, %r12d
testl %eax, %eax
js 0xb0d7
movq %rsp, %r13
xorl %r15d, %r15d
movq 0x10(%rsp), %rdi
callq 0x41c0
movl %r12d, %ecx
cmpq %rcx, %rax
jne 0xb0c1
movq %r14, %rdi
movl $0xa, %esi
movq %r13, %rdx
callq 0x1ca2a
movl %eax, %r12d
incl %r15d
testl %eax, %eax
jns 0xb093
jmp 0xb0da
leaq 0x8b971(%rip), %rdi     # 0x96a39
movl %r12d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x49e0
jmp 0xb0a5
xorl %r15d, %r15d
cmpl $-0x1, %r12d
jne 0xb125
cmpl %ebp, %r15d
jne 0xb138
movq %r14, %rdi
callq 0x1c442
movq 0x10(%rsp), %rdi
callq 0x45c0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8b9a7(%rip), %rdi     # 0x96ab4
movq %rbx, %rsi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x49e0
leaq 0x8b937(%rip), %rdi     # 0x96a63
movq %rbx, %rsi
xorl %eax, %eax
callq 0x49e0
jmp 0xb0e0
leaq 0x8b945(%rip), %rdi     # 0x96a84
movl %r15d, %esi
movq %rbx, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x49e0
jmp 0xb0e5
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/sam.c
// Function: check_aux_count
static void check_aux_count(const bam1_t *aln, int expected, const char *what)
{
    const uint8_t *itr;
    int n = 0;
    for (itr = bam_aux_first(aln); itr; itr = bam_aux_next(aln, itr)) n++;
    if (n != expected)
        fail("%s has %d aux fields, expected %d", what, n, expected);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
callq 0x3347a
xorl %ebp, %ebp
testq %rax, %rax
je 0xb6bd
incl %ebp
movq %r15, %rdi
movq %rax, %rsi
callq 0x334c8
jmp 0xb6a9
cmpl %ebx, %ebp
jne 0xb6cc
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8a2b6(%rip), %rdi     # 0x95989
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x49e0
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/sam.c
// Function: check_int_B_array
static void check_int_B_array(bam1_t *aln, char *tag,
                             uint32_t nvals, int64_t *vals) {
    uint8_t *p;
    if ((p = check_bam_aux_get(aln, tag, 'B')) != NULL) {
        uint32_t i;

        if (bam_auxB_len(p) != nvals)
            fail("Wrong length reported for %s field, got %u, expected %u",
                 tag, bam_auxB_len(p), nvals);

        for (i = 0; i < nvals; i++) {
            if (bam_auxB2i(p, i) != vals[i]) {
                fail("Wrong value from bam_auxB2i for %s field index %u, "
                     "got %"PRId64" expected %"PRId64,
                     tag, i, bam_auxB2i(p, i), vals[i]);
            }
            if (bam_auxB2f(p, i) != (double) vals[i]) {
                fail("Wrong value from bam_auxB2f for %s field index %u, "
                     "got %f expected %f",
                     tag, i, bam_auxB2f(p, i), (double) vals[i]);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movl $0x42, %edx
callq 0x5ffc
testq %rax, %rax
je 0xb7b7
movq %rax, %r15
movq %rax, %rdi
callq 0x33f17
cmpl %ebp, %eax
jne 0xb7c6
testl %ebp, %ebp
je 0xb7b7
movl %ebp, %r12d
leaq 0x8a2ad(%rip), %r13     # 0x959e3
xorl %ebp, %ebp
movq %r15, %rdi
movl %ebp, %esi
callq 0x33f33
cmpq (%rbx,%rbp,8), %rax
jne 0xb76d
movq %r15, %rdi
movl %ebp, %esi
callq 0x33fc7
xorps %xmm1, %xmm1
cvtsi2sdq (%rbx,%rbp,8), %xmm1
ucomisd %xmm1, %xmm0
jne 0xb78f
jp 0xb78f
incq %rbp
cmpq %rbp, %r12
jne 0xb738
jmp 0xb7b7
movq %r15, %rdi
movl %ebp, %esi
callq 0x33f33
movq (%rbx,%rbp,8), %r8
movq %r13, %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x49e0
jmp 0xb748
movq %r15, %rdi
movl %ebp, %esi
callq 0x33fc7
xorps %xmm1, %xmm1
cvtsi2sdq (%rbx,%rbp,8), %xmm1
leaq 0x8a282(%rip), %rdi     # 0x95a2b
movq %r14, %rsi
movl %ebp, %edx
movb $0x2, %al
callq 0x49e0
jmp 0xb763
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x33f17
leaq 0x8a1d6(%rip), %rdi     # 0x959ab
movq %r14, %rsi
movl %eax, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x49e0
jmp 0xb724
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/sam.c
// Function: test_update_int
static int test_update_int(bam1_t *aln,
                           const char target_id[2], int64_t target_val,
                           char expected_type,
                           const char next_id[2], int64_t next_val,
                           char next_type) {
    uint8_t *p;

    // Try updating target
    if (bam_aux_update_int(aln, target_id, target_val) < 0) {
        fail("update %.2s tag", target_id);
        return -1;
    }

    // Check it's there and has the right type and value
    p = bam_aux_get(aln, target_id);
    if (!p) {
        fail("find  %.2s tag", target_id);
        return -1;
    }
    if (*p != expected_type || bam_aux2i(p) != target_val) {
        fail("%.2s field is %c:%"PRId64"; expected %c:%"PRId64,
             target_id, *p, bam_aux2i(p), expected_type, target_val);
        return -1;
    }

    // If given, check that the next tag hasn't been clobbered by the
    // update above.
    if (!*next_id) return 0;
    p = bam_aux_get(aln, next_id);
    if (!p) {
        fail("find  %.2s tag after updating %.2s", next_id, target_id);
        return -1;
    }
    if (*p != next_type || bam_aux2i(p) != next_val) {
        fail("after updating %.2s to %"PRId64":"
             " %.2s field is %c:%"PRId64"; expected %c:%"PRId64,
             target_id, target_val,
             next_id, *p, bam_aux2i(p), next_type, next_val);
        return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movq %r8, %r15
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r13
callq 0x33839
testl %eax, %eax
js 0xb8c1
movq %r13, %rdi
movq %rbx, %rsi
callq 0x313f1
testq %rax, %rax
je 0xb8ca
movq %rax, %r12
movb (%rax), %al
cmpb %bpl, %al
jne 0xb8e1
movq %r12, %rdi
callq 0x33dff
cmpq %r14, %rax
jne 0xb8dd
xorl %ebp, %ebp
cmpb $0x0, (%r15)
je 0xb929
movq %r13, %rdi
movq %r15, %rsi
callq 0x313f1
testq %rax, %rax
je 0xb910
movq %rax, %r13
movb 0x40(%rsp), %r12b
movb (%rax), %al
cmpb %r12b, %al
jne 0xb88a
movq %r13, %rdi
callq 0x33dff
cmpq (%rsp), %rax
je 0xb929
movb (%r13), %al
movzbl %r12b, %r12d
movzbl %al, %ebp
movq %r13, %rdi
callq 0x33dff
leaq 0x8a213(%rip), %rdi     # 0x95ab3
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
movl %ebp, %r8d
movq %rax, %r9
xorl %eax, %eax
pushq (%rsp)
pushq %r12
callq 0x49e0
addq $0x10, %rsp
jmp 0xb924
leaq 0x8a1a9(%rip), %rdi     # 0x95a71
jmp 0xb8d1
leaq 0x8a1b0(%rip), %rdi     # 0x95a81
movq %rbx, %rsi
xorl %eax, %eax
callq 0x49e0
jmp 0xb924
movb (%r12), %al
movzbl %bpl, %ebp
movzbl %al, %r15d
movq %r12, %rdi
callq 0x33dff
leaq 0x8a1d7(%rip), %rdi     # 0x95acf
movq %rbx, %rsi
movl %r15d, %edx
movq %rax, %rcx
movl %ebp, %r8d
movq %r14, %r9
xorl %eax, %eax
callq 0x49e0
jmp 0xb924
leaq 0x8a179(%rip), %rdi     # 0x95a90
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x49e0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/sam.c
// Function: check_target_names
static int check_target_names(sam_hdr_t *header, int expected_n_targets,
                              const char **expected_targets,
                              const int   *expected_lengths) {
    int i;

    // Check consistency of target_names array
    if (!header->target_name) {
        fail("target_name is NULL");
        return -1;
    }
    if (!header->target_len) {
        fail("target_len is NULL");
        return -1;
    }
    if (header->n_targets != expected_n_targets) {
        fail("header->n_targets (%d) != expected_n_targets (%d)",
             header->n_targets, expected_n_targets);
        return -1;
    }
    for (i = 0; i < expected_n_targets; i++) {
        if (!header->target_name[i]
            || strcmp(header->target_name[i], expected_targets[i]) != 0) {
            fail("header->target_name[%d] (%s) != \"%s\"",
                 i, header->target_name[i] ? header->target_name[i] : "NULL",
                 expected_targets[i]);
            return -1;
        }
        if (header->target_len[i] != expected_lengths[i]) {
            fail("header->target_len[%d] (%d) != %d",
                 i, header->target_len[i], expected_lengths[i]);
            return -1;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq 0x20(%rdi), %rbp
testq %rbp, %rbp
je 0xbee1
movq 0x10(%rdi), %r14
testq %r14, %r14
je 0xbeea
movq %rsi, %r15
movl (%rdi), %esi
cmpl $0x3, %esi
jne 0xbefa
xorl %ebx, %ebx
movq (%rbp,%rbx,8), %r13
movq (%r15,%rbx,8), %r12
testq %r13, %r13
je 0xbf0f
movq %r13, %rdi
movq %r12, %rsi
callq 0x46c0
testl %eax, %eax
jne 0xbf16
movl (%r14,%rbx,4), %edx
movq (%rsp), %rax
movl (%rax,%rbx,4), %ecx
cmpl %ecx, %edx
jne 0xbf2e
incq %rbx
cmpq $0x3, %rbx
jne 0xbea8
xorl %eax, %eax
jmp 0xbf43
leaq 0x8a2ea(%rip), %rdi     # 0x961d2
jmp 0xbef1
leaq 0x8a2f5(%rip), %rdi     # 0x961e6
xorl %eax, %eax
callq 0x49e0
jmp 0xbf3e
leaq 0x8a2f8(%rip), %rdi     # 0x961f9
movl $0x3, %edx
xorl %eax, %eax
callq 0x49e0
jmp 0xbf3e
leaq 0x8fc14(%rip), %r13     # 0x9bb2a
leaq 0x8a30e(%rip), %rdi     # 0x9622b
movl %ebx, %esi
movq %r13, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x49e0
jmp 0xbf3e
leaq 0x8a31b(%rip), %rdi     # 0x96250
movl %ebx, %esi
xorl %eax, %eax
callq 0x49e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/sam.c
// Function: check_ref_lookup
static void check_ref_lookup(sam_hdr_t *header, const char *msg, ...) {
    const char *name;
    va_list args;
    va_start(args, msg);
    while ((name = va_arg(args, const char *)) != NULL) {
        int exp = va_arg(args, int);
        int tid = sam_hdr_name2tid(header, name);
        if (tid != exp)
            fail("%s: altname \"%s\" => %d (expected %d)", msg, name, tid, exp);
    }
    va_end(args);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xc413
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x8a540(%rip), %r15     # 0x9697a
movl (%rsp), %eax
cmpq $0x28, %rax
ja 0xc453
movq %rax, %rcx
addq 0x10(%rsp), %rcx
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0xc461
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq (%rcx), %r12
testq %r12, %r12
je 0xc4b3
cmpl $0x28, %eax
ja 0xc47d
movl %eax, %ecx
addq 0x10(%rsp), %rcx
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0xc48b
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rax
movq %rax, 0x8(%rsp)
movl (%rcx), %ebp
movq %r14, %rdi
movq %r12, %rsi
callq 0x1457e
cmpl %ebp, %eax
je 0xc43a
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x49e0
jmp 0xc43a
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/sam.c
// Function: check_ref_lengths
static int check_ref_lengths(const sam_hdr_t *header,
                             const hts_pos_t *expected_lengths,
                             int num_refs, const char *hdr_name)
{
    int i;
    for (i = 0; i < num_refs; i++) {
        hts_pos_t ln = sam_hdr_tid2len(header, i);
        if (ln != expected_lengths[i]) {
            fail("Wrong length for %s ref %d : "
                 "expected %"PRIhts_pos" got %"PRIhts_pos"\n",
                 hdr_name, i, expected_lengths[i], ln);
            return -1;
        }
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
xorl %r14d, %r14d
movq %r12, %rdi
movl %r14d, %esi
callq 0x14706
movq (%r15,%r14,8), %rcx
cmpq %rcx, %rax
jne 0xc502
incq %r14
cmpq $0x4, %r14
jne 0xc4d7
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x8a8c3(%rip), %rdi     # 0x96dcc
movq %rbx, %rsi
movl %r14d, %edx
movq %rax, %r8
xorl %eax, %eax
callq 0x49e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xc4f6
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/sam.c
// Function: test_parse_decimal1
static void test_parse_decimal1(long long exp, const char *str, size_t exp_consumed, int flags, const char *warning)
{
    if (warning) fprintf(stderr, "(Expect %s message for \"%s\")\n", warning, str);

    long long val = hts_parse_decimal(str, NULL, flags);
    if (val != exp) fail("hts_parse_decimal(\"%s\", NULL, %d) returned %lld, expected %lld", str, flags, val, exp);

    char *end;
    val = hts_parse_decimal(str, &end, flags);
    if (val != exp) fail("hts_parse_decimal(\"%s\", ..., %d) returned %lld, expected %lld", str, flags, val, exp);
    size_t consumed = end - str;
    if (consumed != exp_consumed) fail("hts_parse_decimal(\"%s\", ..., %d) consumed %zu chars, expected %zu", str, flags, consumed, exp_consumed);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %r8, %r8
jne 0xc571
movq %r14, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x20c1f
cmpq %r15, %rax
jne 0xc591
movq %rsp, %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x20c1f
cmpq %r15, %rax
jne 0xc5ac
movq (%rsp), %rcx
subq %r14, %rcx
cmpq %rbx, %rcx
jne 0xc5c7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xaea68(%rip), %rax     # 0xbafe0
movq (%rax), %rdi
leaq 0x8a92c(%rip), %rsi     # 0x96eae
movq %r8, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x4700
jmp 0xc537
leaq 0x8a934(%rip), %rdi     # 0x96ecc
movq %r14, %rsi
movl %ebp, %edx
movq %rax, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x49e0
jmp 0xc548
leaq 0x8a958(%rip), %rdi     # 0x96f0b
movq %r14, %rsi
movl %ebp, %edx
movq %rax, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x49e0
jmp 0xc55a
leaq 0x8a97b(%rip), %rdi     # 0x96f49
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %r8
xorl %eax, %eax
callq 0x49e0
jmp 0xc566
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/sam.c
// Function: read_data_block
static int read_data_block(const char *in_name, samFile *fp_in,
                           const char *out_name, samFile *fp_out,
                           sam_hdr_t *header, bam1_t *recs, size_t max_recs,
                           uint8_t *buffer, size_t bufsz, size_t *nrecs_out) {
    size_t buff_used = 0, nrecs;
    uint32_t new_m_data;
    int ret = -1, res = -1;

    for (nrecs = 0; nrecs < max_recs; nrecs++) {
        bam_set_mempolicy(&recs[nrecs],
                          BAM_USER_OWNS_STRUCT|BAM_USER_OWNS_DATA);

        recs[nrecs].data = &buffer[buff_used];
        recs[nrecs].m_data = bufsz - buff_used;

        res = sam_read1(fp_in, header, &recs[nrecs]);
        if (res < 0) break; // EOF or error

        if (fp_out) {
            if (sam_write1(fp_out, header, &recs[nrecs]) < 0) {
                nrecs++; // To return correct count
                fail("sam_write1() to \"%s\"", out_name);
                goto out;
            }
        }

        if ((bam_get_mempolicy(&recs[nrecs]) & BAM_USER_OWNS_DATA) == 0) {
            continue;  // Data not put in buffer
        }

        new_m_data = ((uint32_t) recs[nrecs].l_data + 7) & (~7U);
        if (new_m_data < recs[nrecs].m_data) recs[nrecs].m_data = new_m_data;

        buff_used += recs[nrecs].m_data;
    }
    if (res < -1) {
        fail("sam_read1() from \"%s\" failed", in_name);
    } else {
        ret = 0;
    }

 out:
    *nrecs_out = nrecs;
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %r12
movq %rcx, %r13
movq %rdx, 0x8(%rsp)
movq %rsi, %rbp
movq %rdi, 0x10(%rsp)
xorl %ebx, %ebx
xorl %r14d, %r14d
orb $0x3, 0x48(%r15)
movq 0x50(%rsp), %rax
addq %rbx, %rax
movq %rax, 0x38(%r15)
movl $0x249f0, %eax          # imm = 0x249F0
subl %ebx, %eax
movl %eax, 0x44(%r15)
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2ed2f
testl %eax, %eax
js 0xc690
testq %r13, %r13
je 0xc64d
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x32572
testl %eax, %eax
js 0xc6ca
testb $0x2, 0x48(%r15)
je 0xc671
movl 0x40(%r15), %eax
movl 0x44(%r15), %ecx
addl $0x7, %eax
andl $-0x8, %eax
cmpl %ecx, %eax
jae 0xc66c
movl %eax, 0x44(%r15)
movl %eax, %ecx
movl %ecx, %eax
addq %rax, %rbx
incq %r14
addq $0x50, %r15
cmpq $0x3e8, %r14            # imm = 0x3E8
jne 0xc608
xorl %eax, %eax
movl $0x3e8, %r14d           # imm = 0x3E8
movq 0x58(%rsp), %rbx
jmp 0xc69e
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
movq 0x58(%rsp), %rbx
jne 0xc6b0
movq %r14, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8aa23(%rip), %rdi     # 0x970da
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x49e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xc69e
incq %r14
leaq 0x8a9f1(%rip), %rdi     # 0x970c5
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x49e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xc689
nop
// File: /workspace/github_c_makefile_star2_O3/ramirezsebas[P]TP-LISTINGS/./src/capitulo_4/4.7/tsd.c
// Function: merge_sort
void merge_sort(int low, int high) 
{ 
    // calculating mid point of array 
    int mid = low + (high - low) / 2; 
    if (low < high) { 
  
        // calling first half 
        merge_sort(low, mid); 
  
        // calling second half 
        merge_sort(mid + 1, high); 
  
        // merging the two halves 
        merge(low, mid, high); 
    } 
}

// Assembly:
movl %esi, %eax
subl %edi, %eax
jle 0x1469
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movl %edi, %r14d
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
leal (%r12,%r14), %r15d
movl %r15d, %esi
callq 0x1418
leal (%r12,%r14), %edi
incl %edi
movl %ebx, %esi
callq 0x1418
movl %r14d, %edi
movl %r15d, %esi
movl %ebx, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1274
retq
// File: /workspace/github_c_makefile_star2_O3/ramirezsebas[P]TP-LISTINGS/./src/capitulo_4/4.7/tsd.c
// Function: create_random_array
void create_random_array(){
	time_t t;

	srand((unsigned) time(&t));

	int i;
	for(i = 0; i < MAX; ++i){
		a[i] = rand() % 100;
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq -0x18(%rbp), %rdi
callq 0x10b0
movl %eax, %edi
callq 0x1080
xorl %ebx, %ebx
leaq 0x2aaf(%rip), %r14      # 0x40d0
callq 0x1120
cltq
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x64, %ecx, %ecx
subl %ecx, %eax
movl %eax, (%rbx,%r14)
addq $0x4, %rbx
cmpq $0x50, %rbx
jne 0x1621
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ramirezsebas[P]TP-LISTINGS/./src/capitulo_4/4.7/tsd.c
// Function: main
int main ()
{
	int i;

	create_random_array();

	pthread_t threads[THREAD_MAX];
	/* Create a key to associate thread log file pointers in
	thread-specific data. Use close_thread_log to clean up the file
	pointers. */ 
	pthread_key_create (&thread_log_key, close_thread_log);
	/* Create threads to do the work. */
	for (i = 0; i < THREAD_MAX; ++i)
		pthread_create (&(threads[i]), NULL, merge_sort_multithreading, NULL);
	/* Wait for all threads to finish. */
	for (i = 0; i < THREAD_MAX; ++i)
		pthread_join (threads[i], NULL);

	merge(0, (MAX / 2 - 1) / 2, MAX / 2 - 1); 
    merge(MAX / 2, MAX/2 + (MAX-1-MAX/2)/2, MAX - 1); 
    merge(0, (MAX - 1)/2, MAX - 1); 

	for (i = 0; i < MAX; ++i)
		printf("%d\n", a[i]);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
callq 0x15fd
leaq 0x2a53(%rip), %rdi      # 0x40c4
leaq -0x40e(%rip), %rsi      # 0x126a
callq 0x1070
xorl %r14d, %r14d
leaq -0x21d(%rip), %rbx      # 0x146a
leaq (%r14,%rbp), %rdi
addq $-0x40, %rdi
xorl %esi, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x10d0
addq $0x8, %r14
cmpq $0x20, %r14
jne 0x1687
xorl %ebx, %ebx
movq -0x40(%rbp,%rbx,8), %rdi
xorl %esi, %esi
callq 0x1110
incq %rbx
cmpq $0x4, %rbx
jne 0x16a7
xorl %edi, %edi
movl $0x4, %esi
movl $0x9, %edx
callq 0x1274
movl $0xa, %edi
movl $0xe, %esi
movl $0x13, %edx
callq 0x1274
xorl %edi, %edi
movl $0x9, %esi
movl $0x13, %edx
callq 0x1274
leaq 0x29d7(%rip), %r14      # 0x40d0
leaq 0x998(%rip), %rbx       # 0x2098
xorl %r15d, %r15d
movl (%r15,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1060
addq $0x4, %r15
cmpq $0x50, %r15
jne 0x1703
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lyda[P]tz/zic.c
// Function: error
static void
error(string)
const char * const	string;
{
	/*
	** Match the format of "cc" to allow sh users to
	**	zic ... 2>&1 | error -t "*" -v
	** on BSD systems.
	*/
	(void) fprintf(stderr, _("\"%s\", line %d: %s"),
		filename, linenum, string);
	if (rfilename != NULL)
		(void) fprintf(stderr, _(" (rule from \"%s\", line %d)"),
			rfilename, rlinenum);
	(void) fprintf(stderr, "\n");
	++errors;
}

// Assembly:
pushq %rbx
movq %rdi, %r8
movq 0xbced(%rip), %rbx      # 0xdff8
movq (%rbx), %rdi
movq 0xbf13(%rip), %rdx      # 0xe228
movl 0xbf15(%rip), %ecx      # 0xe230
leaq 0x804d(%rip), %rsi      # 0xa36f
xorl %eax, %eax
callq 0x21c0
movq 0xbf08(%rip), %rdx      # 0xe238
testq %rdx, %rdx
jne 0x2348
movq (%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x2150
incl 0xbebe(%rip)            # 0xe204
popq %rbx
retq
movq (%rbx), %rdi
movl 0xbeef(%rip), %ecx      # 0xe240
leaq 0x8029(%rip), %rsi      # 0xa381
xorl %eax, %eax
callq 0x21c0
jmp 0x2335
// File: /workspace/github_c_makefile_star2_O3/lyda[P]tz/zic.c
// Function: warning
static void
warning(string)
const char * const	string;
{
	char *	cp;

	cp = ecpyalloc(_("warning: "));
	cp = ecatalloc(cp, string);
	error(cp);
	ifree(cp);
	--errors;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x48b0(%rip), %rdi      # 0xa34b
callq 0x9d64
movq %rax, %r14
movq %rax, %rdi
callq 0x5adf
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9cc8
movq %rax, %rbx
movq %rax, %rdi
callq 0x5adf
movq %rbx, %rdi
callq 0x2300
movq %rbx, %rdi
callq 0x9d6e
decl 0x872d(%rip)            # 0xe204
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/lyda[P]tz/zic.c
// Function: itsdir
static int
itsdir(name)
const char * const	name;
{
	register char *	myname;
	register int	accres;

	myname = ecpyalloc(name);
	myname = ecatalloc(myname, "/.");
	accres = access(myname, F_OK);
	ifree(myname);
	return accres == 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
callq 0x9d64
movq %rax, %rbx
movq %rax, %rdi
callq 0x5adf
leaq 0x48df(%rip), %rsi      # 0xa3e7
movq %rbx, %rdi
callq 0x9cc8
movq %rax, %rbx
movq %rax, %rdi
callq 0x5adf
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2250
movl %eax, %ebp
movq %rbx, %rdi
callq 0x9d6e
xorl %eax, %eax
testl %ebp, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lyda[P]tz/zic.c
// Function: mkdirs
static int
mkdirs(argname)
char *		argname;
{
	register char *	name;
	register char *	cp;

	if (argname == NULL || *argname == '\0')
		return 0;
	cp = name = ecpyalloc(argname);
	while ((cp = strchr(cp + 1, '/')) != 0) {
		*cp = '\0';
#ifndef unix
		/*
		** DOS drive specifier?
		*/
		if (isalpha((unsigned char) name[0]) &&
			name[1] == ':' && name[2] == '\0') {
				*cp = '/';
				continue;
		}
#endif /* !defined unix */
		if (!itsdir(name)) {
			/*
			** It doesn't seem to exist, so we try to create it.
			** Creation may fail because of the directory being
			** created by some other multiprocessor, so we get
			** to do extra checking.
			*/
			if (mkdir(name, MKDIR_UMASK) != 0) {
				const char *e = strerror(errno);

				if (errno != EEXIST || !itsdir(name)) {
					(void) fprintf(stderr,
_("%s: Can't create directory %s: %s\n"),
						progname, name, e);
					ifree(name);
					return -1;
				}
			}
		}
		*cp = '/';
	}
	ifree(name);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x5bed
cmpb $0x0, (%rdi)
je 0x5bed
callq 0x9d64
movq %rax, %rbx
movq %rax, %rdi
callq 0x5adf
movq %rbx, %rdi
incq %rdi
movl $0x2f, %esi
callq 0x2100
xorl %ebp, %ebp
testq %rax, %rax
je 0x5be5
movq %rax, %r14
movb $0x0, (%r14)
movq %rbx, %rdi
callq 0x5aee
testl %eax, %eax
jne 0x5bc9
movq %rbx, %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x2090
testl %eax, %eax
je 0x5bc9
callq 0x2050
movq %rax, %r12
movl (%rax), %edi
callq 0x22d0
movq %rax, %r15
cmpl $0x11, (%r12)
jne 0x5bf8
movq %rbx, %rdi
callq 0x5aee
testl %eax, %eax
je 0x5bf8
movb $0x2f, (%r14)
incq %r14
movq %r14, %rdi
movl $0x2f, %esi
callq 0x2100
movq %rax, %r14
testq %rax, %rax
jne 0x5b83
movq %rbx, %rdi
callq 0x9d6e
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x83f9(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq 0x85c7(%rip), %rdx      # 0xe1d0
leaq 0x47da(%rip), %rsi      # 0xa3ea
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x21c0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x5be5