LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/MicBrain[P]Git-Sample/beargit.c
// Function: next_commit_id
void next_commit_id(char* commit_id) {
  char current_branch[BRANCHNAME_SIZE];
  read_string_from_file(".beargit/.current_branch", current_branch, BRANCHNAME_SIZE);
  int n = get_branch_number(current_branch);
  for (int i = 0; i < COMMIT_ID_BRANCH_BYTES; i++) {
    commit_id[i] = digits[n%3];
    n /= 3;
  }
  next_commit_id_hw1(commit_id + COMMIT_ID_BRANCH_BYTES);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq 0xecd(%rip), %rdi       # 0x41c6
leaq -0x90(%rbp), %r14
movq %r14, %rsi
movl $0x80, %edx
callq 0x328e
movq %r14, %rdi
callq 0x373d
xorl %ecx, %ecx
movq 0x3dca(%rip), %rdx      # 0x70e8
movslq %eax, %rsi
imulq $0x55555556, %rsi, %rax # imm = 0x55555556
movq %rax, %rdi
shrq $0x3f, %rdi
shrq $0x20, %rax
addl %edi, %eax
leal (%rax,%rax,2), %edi
subl %edi, %esi
movslq %esi, %rsi
movb (%rdx,%rsi), %dl
movb %dl, (%rbx,%rcx)
incq %rcx
cmpq $0xa, %rcx
jne 0x3317
addq $0xa, %rbx
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x301e
// File: /workspace/github_c_makefile_star2_O3/MicBrain[P]Git-Sample/./util.h
// Function: fs_cp
static void fs_cp(const char* src, const char* dst) {
  ASSERT_ERROR_MESSAGE(src != NULL, "src is not a valid string");
  ASSERT_ERROR_MESSAGE(dst != NULL, "dst is not a valid string");
  ASSERT_ERROR_MESSAGE(is_sane_path(dst), "dst is not a valid path within .beargit");

  FILE* fin = fopen(src, "r");
  ASSERT_ERROR_MESSAGE(fin != NULL, "couldn't open source file");
  FILE* fout = fopen(dst, "w");
  ASSERT_ERROR_MESSAGE(fout != NULL, "couldn't open destination file");

  char buffer[4096];
  int size;

  while ((size = fread(buffer, 1, 4096, fin)) > 0) {
    fwrite(buffer, 1, size, fout);
  }

  fclose(fin);
  fclose(fout);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
testq %rdi, %rdi
je 0x3447
movq %rsi, %r15
movq %rdi, %r12
testq %rsi, %rsi
je 0x344c
movq %r15, %rdi
callq 0x3e8c
testl %eax, %eax
je 0x3454
leaq 0xde8(%rip), %rsi       # 0x418c
movq %r12, %rdi
callq 0x1120
testq %rax, %rax
je 0x345f
movq %rax, %rbx
leaq 0xdb3(%rip), %rsi       # 0x4172
movq %r15, %rdi
callq 0x1120
testq %rax, %rax
je 0x346a
movq %rax, %r14
leaq -0x1020(%rbp), %rdi
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rcx
callq 0x1060
testl %eax, %eax
jle 0x3428
leaq -0x1020(%rbp), %r15
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %esi
movq %r15, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0x1190
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1060
testl %eax, %eax
jg 0x33f7
movq %rbx, %rdi
callq 0x1070
movq %r14, %rdi
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1070
callq 0x25cd
movq %r12, %rdi
callq 0x24a9
movq %r12, %rdi
movq %r15, %rsi
callq 0x2353
movq %r12, %rdi
movq %r15, %rsi
callq 0x21fd
movq %r12, %rdi
movq %r15, %rsi
callq 0x20a7
// File: /workspace/github_c_makefile_star2_O3/MicBrain[P]Git-Sample/beargit.c
// Function: beargit_status
int beargit_status() {
  FILE* findex = fopen(".beargit/.index", "r");
  char line[FILENAME_SIZE];
  int counter = 0;
  fprintf(stdout, "%s\n", "Tracked files:");
  while (fgets(line, sizeof(line), findex)) {
    counter++;
    strtok(line, "\n");
    printf("\n");
    fprintf(stdout, "%s", "  ");
    fprintf(stdout, "%s", line);
  }
  fprintf(stdout, "\n\n");
  fprintf(stdout, "%d", counter);
  fprintf(stdout, "%s", " ");
  fprintf(stdout, "%s\n", "files total");
  fclose(findex);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
leaq 0xcd2(%rip), %rdi       # 0x4162
leaq 0xcf5(%rip), %rsi       # 0x418c
callq 0x1120
movq %rax, %rbx
movq 0x3b32(%rip), %r15      # 0x6fd8
movq (%r15), %rdi
leaq 0xdf0(%rip), %rsi       # 0x42a0
leaq 0xdab(%rip), %rdx       # 0x4262
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x10d0
leaq -0x230(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdx
callq 0x10b0
testq %rax, %rax
je 0x3532
xorl %r14d, %r14d
leaq -0x230(%rbp), %r12
leaq 0xd86(%rip), %r13       # 0x4271
incl %r14d
movq %r12, %rdi
leaq 0xeb6(%rip), %rsi       # 0x43ae
callq 0x1130
movl $0xa, %edi
callq 0x1030
movq (%r15), %rsi
movq %r13, %rdi
callq 0x1090
movq (%r15), %rsi
movq %r12, %rdi
callq 0x1090
movq %r12, %rdi
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdx
callq 0x10b0
testq %rax, %rax
jne 0x34eb
movq (%r15), %rcx
leaq 0xe71(%rip), %rdi       # 0x43ad
movl $0x2, %esi
movl $0x1, %edx
callq 0x1190
movq (%r15), %rdi
leaq 0xd1f(%rip), %rsi       # 0x4274
movl %r14d, %edx
xorl %eax, %eax
callq 0x10d0
movq (%r15), %rsi
leaq 0xd09(%rip), %rdi       # 0x4272
callq 0x1090
movq (%r15), %rdi
leaq 0xd28(%rip), %rsi       # 0x42a0
leaq 0xcf8(%rip), %rdx       # 0x4277
xorl %eax, %eax
callq 0x10d0
movq %rbx, %rdi
callq 0x1070
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/MicBrain[P]Git-Sample/beargit.c
// Function: beargit_log
int beargit_log() {
  char last_commit[COMMIT_ID_SIZE]; 
  int index = 0;
  int checker = 10; 
  read_string_from_file(".beargit/.prev", last_commit, COMMIT_ID_SIZE);
  while (strcmp(last_commit, "0000000000000000000000000000000000000000") != 0) {
    char content[100];
    fprintf(stdout, "\ncommit %s", last_commit);
    checker = 50;
    sprintf(content, "%s%s%s", ".beargit/", last_commit, "/.msg");
    read_string_from_file(content, content, 120);
    char lastSource[100];
    fprintf(stdout, "\n    %s\n", content);
    sprintf(lastSource, "%s%s%s", ".beargit/", last_commit,  "/.prev");
    read_string_from_file(lastSource, last_commit, COMMIT_ID_SIZE);
  }
  if (checker == 10) {
    fprintf(stderr, "ERROR: There are no commits!\n");
    return 1;
  }
  if (checker == 50)
    fprintf(stdout, "\n");
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
leaq 0xbd1(%rip), %rdi       # 0x418e
leaq -0x60(%rbp), %rbx
movq %rbx, %rsi
movl $0x29, %edx
callq 0x328e
leaq 0xbc8(%rip), %rsi       # 0x419d
movl $0x29, %edx
movq %rbx, %rdi
callq 0x1100
testl %eax, %eax
je 0x36d6
movl %eax, -0x2c(%rbp)
movq 0x39e4(%rip), %r12      # 0x6fd8
leaq -0x60(%rbp), %r15
movq (%r12), %rdi
leaq 0xc80(%rip), %rsi       # 0x4283
movq %r15, %rdx
xorl %eax, %eax
callq 0x10d0
leaq -0x140(%rbp), %r14
movq %r14, %rdi
leaq 0xc70(%rip), %r13       # 0x428e
movq %r13, %rsi
leaq 0xc30(%rip), %rbx       # 0x4258
movq %rbx, %rdx
movq %r15, %rcx
leaq 0xc60(%rip), %r8        # 0x4295
xorl %eax, %eax
callq 0x1170
movq %r14, %rdi
movq %r14, %rsi
movl $0x78, %edx
callq 0x328e
movq (%r12), %rdi
leaq 0xc44(%rip), %rsi       # 0x429b
movq %r14, %rdx
xorl %eax, %eax
callq 0x10d0
leaq -0xd0(%rbp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
leaq 0xb1b(%rip), %r8        # 0x4196
xorl %eax, %eax
callq 0x1170
movq %r14, %rdi
movq %r15, %rsi
movl $0x29, %edx
callq 0x328e
movl $0x29, %edx
movq %r15, %rdi
leaq 0xafc(%rip), %rsi       # 0x419d
callq 0x1100
testl %eax, %eax
jne 0x35f8
cmpl $0x0, -0x2c(%rbp)
je 0x36d6
movq (%r12), %rsi
movl $0xa, %edi
callq 0x10a0
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x26cf
movl $0x1, %eax
jmp 0x36c4
// File: /workspace/github_c_makefile_star2_O3/MicBrain[P]Git-Sample/beargit.c
// Function: beargit_commit
int beargit_commit(const char* msg) {
  char current_branch[BRANCHNAME_SIZE];
  read_string_from_file(".beargit/.current_branch", current_branch, BRANCHNAME_SIZE);
  if (strlen(current_branch) == 0) {
    fprintf(stderr, "ERROR: Need to be on HEAD of a branch to commit\n");
    return 1;
  }
  return beargit_commit_hw1(msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq 0xacc(%rip), %rdi       # 0x41c6
leaq -0x90(%rbp), %r14
movq %r14, %rsi
movl $0x80, %edx
callq 0x328e
cmpb $0x0, (%r14)
je 0x3727
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x3084
callq 0x26f1
movl $0x1, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/MicBrain[P]Git-Sample/beargit.c
// Function: get_branch_number
int get_branch_number(const char* branch_name) {
  FILE* fbranches = fopen(".beargit/.branches", "r");
  int branch_index = -1;
  int counter = 0;
  char line[FILENAME_SIZE];
  while(fgets(line, sizeof(line), fbranches)) {
    strtok(line, "\n");
    if (strcmp(line, branch_name) == 0) {
      branch_index = counter;
    }
    counter++;
  }
  fclose(fbranches);
  return branch_index;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
leaq 0xa19(%rip), %rdi       # 0x4174
leaq 0xa2a(%rip), %rsi       # 0x418c
callq 0x1120
movq %rax, %r14
leaq -0x230(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
movq %rax, %rdx
callq 0x10b0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x37cb
xorl %r12d, %r12d
leaq -0x230(%rbp), %r13
movq %r13, %rdi
leaq 0xc11(%rip), %rsi       # 0x43ae
callq 0x1130
movq %r13, %rdi
movq %rbx, %rsi
callq 0x10c0
testl %eax, %eax
cmovel %r12d, %r15d
incl %r12d
movq %r13, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdx
callq 0x10b0
testq %rax, %rax
jne 0x3793
movq %r14, %rdi
callq 0x1070
movl %r15d, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/MicBrain[P]Git-Sample/beargit.c
// Function: beargit_branch
int beargit_branch() {
  char current_branch[BRANCHNAME_SIZE];
  read_string_from_file(".beargit/.current_branch", current_branch, BRANCHNAME_SIZE);
  FILE* findex = fopen(".beargit/.branches", "r");
  char line[BRANCHNAME_SIZE];
  while (fgets(line, sizeof(line), findex)) {
    strtok(line, "\n");
    if (strcmp(line, current_branch) != 0) {
      fprintf(stdout, "%s", "  ");
      fprintf(stdout, "%s\n", line);
    } else {
      fprintf(stdout, "%s", "* ");
      fprintf(stdout, "%s\n", line);
    }
  }
  fclose(findex);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
leaq 0x9c3(%rip), %rdi       # 0x41c6
leaq -0x130(%rbp), %rsi
movl $0x80, %edx
callq 0x328e
leaq 0x959(%rip), %rdi       # 0x4174
leaq 0x96a(%rip), %rsi       # 0x418c
callq 0x1120
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
movl $0x80, %esi
movq %rax, %rdx
callq 0x10b0
testq %rax, %rax
je 0x38ba
leaq -0xb0(%rbp), %r15
movq 0x3787(%rip), %r14      # 0x6fd8
leaq 0xa19(%rip), %r12       # 0x4271
leaq 0xa41(%rip), %r13       # 0x42a0
movq %r15, %rdi
leaq 0xb45(%rip), %rsi       # 0x43ae
callq 0x1130
movq %r15, %rdi
leaq -0x130(%rbp), %rsi
callq 0x10c0
testl %eax, %eax
movq (%r14), %rsi
movq %r12, %rdi
leaq 0xa6b(%rip), %rax       # 0x42f7
cmoveq %rax, %rdi
callq 0x1090
movq (%r14), %rdi
movq %r13, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x10d0
movq %r15, %rdi
movl $0x80, %esi
movq %rbx, %rdx
callq 0x10b0
testq %rax, %rax
jne 0x385f
movq %rbx, %rdi
callq 0x1070
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/MicBrain[P]Git-Sample/beargit.c
// Function: checkout_commit
int checkout_commit(const char* commit_id) {
  if (strcmp(commit_id, "0000000000000000000000000000000000000000") == 0) {
    write_string_to_file(".beargit/.index", "");
  } else {
    FILE* findex = fopen(".beargit/.index", "r");
    char line[BRANCHNAME_SIZE];
    while(fgets(line, sizeof(line), findex)) {
      strtok(line, "\n");
      fs_rm(line);
    }
    fclose(findex);
    char init_loc[150];
    sprintf(init_loc, "%s%s%s", ".beargit/", commit_id, "/.index");
    FILE* last = fopen(init_loc, "r");
    char new_line[BRANCHNAME_SIZE];
    while(fgets(new_line, sizeof(new_line), last)) {
      strtok(new_line, "\n");
      char final_place[200];
      sprintf(final_place, ".beargit/%s/%s", commit_id, new_line);
      fs_cp(final_place, new_line);
    }
    fs_cp(init_loc, ".beargit/.index");
    fclose(last);
  }
  write_string_to_file(".beargit/.prev", commit_id);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rdi, %r12
leaq 0x8a9(%rip), %rsi       # 0x419d
callq 0x10c0
leaq 0x862(%rip), %rdi       # 0x4162
testl %eax, %eax
je 0x3a3c
leaq 0x87d(%rip), %rsi       # 0x418c
callq 0x1120
movq %rax, %r14
leaq -0x130(%rbp), %rdi
movl $0x80, %esi
movq %rax, %rdx
callq 0x10b0
testq %rax, %rax
je 0x3966
leaq 0xa77(%rip), %rbx       # 0x43ae
leaq -0x130(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1130
movq %r15, %rdi
callq 0x2e0d
movq %r15, %rdi
movl $0x80, %esi
movq %r14, %rdx
callq 0x10b0
testq %rax, %rax
jne 0x393e
movq %r14, %rdi
callq 0x1070
leaq 0x919(%rip), %rsi       # 0x428e
leaq 0x8dc(%rip), %rdx       # 0x4258
leaq 0x7e7(%rip), %r8        # 0x416a
leaq -0x1d0(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x1170
leaq 0x7ee(%rip), %rsi       # 0x418c
movq %rbx, %rdi
callq 0x1120
movq %rax, %r14
leaq -0xb0(%rbp), %rdi
movl $0x80, %esi
movq %rax, %rdx
callq 0x10b0
testq %rax, %rax
movq %r12, %r15
je 0x3a1c
leaq -0xb0(%rbp), %r12
leaq 0x927(%rip), %r13       # 0x42fa
leaq -0x2a0(%rbp), %rbx
movq %r12, %rdi
leaq 0x9ca(%rip), %rsi       # 0x43ae
callq 0x1130
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x1170
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3363
movq %r12, %rdi
movl $0x80, %esi
movq %r14, %rdx
callq 0x10b0
testq %rax, %rax
jne 0x39da
leaq 0x73f(%rip), %rsi       # 0x4162
leaq -0x1d0(%rbp), %rdi
callq 0x3363
movq %r14, %rdi
callq 0x1070
movq %r15, %r12
jmp 0x3a48
leaq 0x96c(%rip), %rsi       # 0x43af
callq 0x2caf
leaq 0x73f(%rip), %rdi       # 0x418e
movq %r12, %rsi
callq 0x2caf
xorl %eax, %eax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/MicBrain[P]Git-Sample/beargit.c
// Function: is_it_a_commit_id
int is_it_a_commit_id(const char* commit_id) {
  if (strlen(commit_id) != 40) {
    return 0;
  } else {
    while (*commit_id !='\0') {
      if (*commit_id != '6' && *commit_id != '1' && *commit_id != 'c') {
        return 0;
      }
      commit_id++;
    }
    return 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x1080
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x28, %rcx
jne 0x3aad
movabsq $0x4000000000021, %rcx  # imm = 0x4000000000021
movzbl (%rbx), %edx
leal -0x31(%rdx), %esi
cmpl $0x32, %esi
ja 0x3aa4
btq %rsi, %rcx
jae 0x3aa4
incq %rbx
jmp 0x3a8e
testl %edx, %edx
jne 0x3aad
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/MicBrain[P]Git-Sample/util.c
// Function: fake_print
int fake_print(char* fmt, ...) {
    // append to file
    char data[2048]; // if your line is longer than this, you're doing something wrong
    va_list args;
    va_start(args, fmt);
    vsprintf(data, fmt, args);
    va_end(args);
    FILE *fp = fopen(file_stdout, "a");
    if (fp != NULL) {
        fputs(data, fp);
        fclose(fp);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x8c8, %rsp            # imm = 0x8C8
movq %rdi, %r10
leaq -0xd0(%rbp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x3d10
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
leaq -0x20(%rbp), %rdx
movq %rdi, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
leaq -0x8d0(%rbp), %rdi
movq %r10, %rsi
callq 0x1110
movq 0x33ad(%rip), %rdi      # 0x70f0
leaq 0x639(%rip), %rsi       # 0x4383
callq 0x1120
testq %rax, %rax
je 0x3d6e
movq %rax, %rbx
leaq -0x8d0(%rbp), %rdi
movq %rax, %rsi
callq 0x1090
movq %rbx, %rdi
callq 0x1070
xorl %eax, %eax
addq $0x8c8, %rsp            # imm = 0x8C8
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/MicBrain[P]Git-Sample/util.c
// Function: fake_fprint
int fake_fprint(FILE* stream, char* fmt, ...) {
    // append to file
    char data[2048]; // if your line is longer than this, you're doing something wrong
    va_list args;
    const char * filename_to_open;
    if (stream == stdout) {
        filename_to_open = file_stdout;
    } else if (stream == stderr) {
        filename_to_open = file_stderr;
    } else {
        va_start(args, fmt);
        vfprintf(stream, fmt, args);
        va_end(args);
        return 0;
    }
    va_start(args, fmt);
    vsprintf(data, fmt, args);
    va_end(args);
    FILE *fp = fopen(filename_to_open, "a");
    if (fp != NULL) {
        fputs(data, fp);
        fclose(fp);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x8c8, %rsp            # imm = 0x8C8
movq %rdx, -0xc0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %r8, -0xb0(%rbp)
movq %r9, -0xa8(%rbp)
testb %al, %al
je 0x3dcc
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq 0x3205(%rip), %rax      # 0x6fd8
cmpq %rdi, (%rax)
je 0x3e0f
movq 0x3219(%rip), %rax      # 0x6ff8
cmpq %rdi, (%rax)
je 0x3e18
leaq -0xd0(%rbp), %rax
leaq -0x20(%rbp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
callq 0x1150
jmp 0x3e80
leaq 0x32da(%rip), %rax      # 0x70f0
jmp 0x3e1f
leaq 0x32d9(%rip), %rax      # 0x70f8
movq (%rax), %rbx
leaq -0xd0(%rbp), %rax
leaq -0x20(%rbp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
leaq -0x8d0(%rbp), %rdi
callq 0x1110
leaq 0x52a(%rip), %rsi       # 0x4383
movq %rbx, %rdi
callq 0x1120
testq %rax, %rax
je 0x3e80
movq %rax, %rbx
leaq -0x8d0(%rbp), %rdi
movq %rax, %rsi
callq 0x1090
movq %rbx, %rdi
callq 0x1070
xorl %eax, %eax
addq $0x8c8, %rsp            # imm = 0x8C8
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jelaas[P]egetty/egetty.c
// Function: console_ucast
int console_ucast(int s, int ifindex, struct sk_buff *skb)
{
	struct sockaddr_ll dest;
	socklen_t destlen = sizeof(dest);

	memset(&dest, 0, sizeof(dest));

	dest.sll_family = AF_PACKET;
	dest.sll_halen = 6;
	dest.sll_protocol = htons(ETH_P_EGETTY);
	dest.sll_ifindex = ifindex;
	memcpy(dest.sll_addr, conf.client.sll_addr, 6);
	
	return sendto(s, skb->data, skb->len, 0, (const struct sockaddr *)&dest, destlen);
}

// Assembly:
subq $0x18, %rsp
leaq 0x4(%rsp), %r8
movq $0x0, 0x8(%r8)
movl $0x0, 0x10(%r8)
movl $0x11680011, (%r8)      # imm = 0x11680011
movb $0x6, 0xb(%r8)
movl %esi, 0x4(%r8)
movl 0xd3a1a(%rip), %eax     # 0x4d5330
movl %eax, 0xc(%r8)
movzwl 0xd3a13(%rip), %eax     # 0x4d5334
movw %ax, 0x10(%r8)
movq 0x38(%rdx), %rsi
movl (%rdx), %edx
xorl %ecx, %ecx
movl $0x14, %r9d
callq 0x4537d0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/jelaas[P]egetty/egetty.c
// Function: console_bcast
int console_bcast(int s, int ifindex, struct sk_buff *skb)
{
	struct sockaddr_ll dest;
	socklen_t destlen = sizeof(dest);

	memset(&dest, 0, sizeof(dest));

	dest.sll_family = AF_PACKET;
	dest.sll_halen = 6;
	dest.sll_protocol = htons(ETH_P_EGETTY);
	dest.sll_ifindex = ifindex;
	memset(dest.sll_addr, 255, 6);
	
	return sendto(s, skb->data, skb->len, 0, (const struct sockaddr *)&dest, destlen);
}

// Assembly:
subq $0x18, %rsp
leaq 0x4(%rsp), %r8
movq $0x0, 0x8(%r8)
movl $0x0, 0x10(%r8)
movl $0x11680011, (%r8)      # imm = 0x11680011
movb $0x6, 0xb(%r8)
movl %esi, 0x4(%r8)
movl $0xffffffff, 0xc(%r8)   # imm = 0xFFFFFFFF
movw $0xffff, 0x10(%r8)      # imm = 0xFFFF
movq 0x38(%rdx), %rsi
movl (%rdx), %edx
xorl %ecx, %ecx
movl $0x14, %r9d
callq 0x4537d0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/jelaas[P]egetty/egetty.c
// Function: console_put
int console_put(int s, int ifindex, struct sk_buff *skb)
{
	int rc;
	uint8_t *p;

	p = skb_push(skb, 4);
	*p++ = EGETTY_OUT;
	*p++ = conf.console;
	*p++ = skb->len >> 8;
	*p = skb->len & 0xff;

	rc = console_ucast(s, ifindex, skb);
	if(rc == -1) {
		printf("sendto failed: %s\n", strerror(errno));
		return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
movq %rdx, %rdi
movl $0x4, %esi
callq 0x40243f
movb $0x5, (%rax)
movb 0xd3954(%rip), %cl      # 0x4d5308
movb %cl, 0x1(%rax)
movb 0x1(%rbx), %cl
movb %cl, 0x2(%rax)
movb (%rbx), %cl
movb %cl, 0x3(%rax)
leaq 0xc(%rsp), %r8
movq $0x0, 0x8(%r8)
movl $0x0, 0x10(%r8)
movl $0x11680011, (%r8)      # imm = 0x11680011
movb $0x6, 0xb(%r8)
movl %ebp, 0x4(%r8)
movl 0xd3943(%rip), %eax     # 0x4d5330
movl %eax, 0xc(%r8)
movzwl 0xd393c(%rip), %eax     # 0x4d5334
movw %ax, 0x10(%r8)
movq 0x38(%rbx), %rsi
movl (%rbx), %edx
xorl %ebx, %ebx
movl %r14d, %edi
xorl %ecx, %ecx
movl $0x14, %r9d
callq 0x4537d0
cmpl $-0x1, %eax
jne 0x401a3c
callq 0x404fb0
movl (%rax), %edi
callq 0x423460
leaq 0xa0658(%rip), %rdi     # 0x4a2085
movq %rax, %rsi
xorl %eax, %eax
callq 0x40ca30
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jelaas[P]egetty/egetty.c
// Function: console_hello
int console_hello(int s, int ifindex, struct sk_buff *skb)
{
	int rc;
	uint8_t *p;

	p = skb_push(skb, 4);
	*p++ = EGETTY_HELLO;
	*p++ = conf.console;
	*p++ = skb->len >> 8;
	*p = skb->len & 0xff;

	rc = console_bcast(s, ifindex, skb);
	if(rc == -1) {
		printf("sendto failed: %s\n", strerror(errno));
		return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
movq %rdx, %rdi
movl $0x4, %esi
callq 0x40243f
movb $0x3, (%rax)
movb 0xd389b(%rip), %cl      # 0x4d5308
movb %cl, 0x1(%rax)
movb 0x1(%rbx), %cl
movb %cl, 0x2(%rax)
movb (%rbx), %cl
movb %cl, 0x3(%rax)
leaq 0xc(%rsp), %r8
movq $0x0, 0x8(%r8)
movl $0x0, 0x10(%r8)
movl $0x11680011, (%r8)      # imm = 0x11680011
movb $0x6, 0xb(%r8)
movl %ebp, 0x4(%r8)
movl $0xffffffff, 0xc(%r8)   # imm = 0xFFFFFFFF
movw $0xffff, 0x10(%r8)      # imm = 0xFFFF
movq 0x38(%rbx), %rsi
movl (%rbx), %edx
xorl %ebx, %ebx
movl %r14d, %edi
xorl %ecx, %ecx
movl $0x14, %r9d
callq 0x4537d0
cmpl $-0x1, %eax
jne 0x401aee
callq 0x404fb0
movl (%rax), %edi
callq 0x423460
leaq 0xa05a6(%rip), %rdi     # 0x4a2085
movq %rax, %rsi
xorl %eax, %eax
callq 0x40ca30
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jelaas[P]egetty/skbuff.c
// Function: alloc_skb
struct sk_buff *alloc_skb(unsigned int size)
{
	struct sk_buff *skb;
	void *data;

	data = malloc(size);
	if(!data) return NULL;
	
	skb = malloc(sizeof(struct sk_buff));
	if(!skb) {
		free(data);
		return NULL;
	}
	memset(skb, 0, sizeof(struct sk_buff));
	skb->head = data;
	skb->data = skb->tail = skb->head;
	skb->end = skb->head + size;
	return skb;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movq %rbx, %rdi
callq 0x420db0
testq %rax, %rax
je 0x40227f
movq %rax, %r14
movl $0x1, %edi
movl $0x40, %esi
callq 0x422200
testq %rax, %rax
je 0x402277
movq %r14, 0x30(%rax)
movq %r14, 0x20(%rax)
movq %r14, 0x38(%rax)
addq %rbx, %r14
movq %r14, 0x28(%rax)
jmp 0x402281
movq %r14, %rdi
callq 0x4210f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jelaas[P]egetty/skbuff.c
// Function: skb_copy_expand
struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
				int newheadroom, int newtailroom)
{
	struct sk_buff *nskb;
	void *ndata;

	ndata = malloc(skb->len + newheadroom + newtailroom);
	if(!ndata) return NULL;
	
	nskb = malloc(sizeof(struct sk_buff));
	if(!nskb) {
		free(ndata);
		return NULL;
	}
	memcpy(nskb, skb, sizeof(struct sk_buff));
	memcpy(ndata + newheadroom, skb->data, skb->len);
	
	nskb->head = ndata;
	nskb->data = ndata + newheadroom;
	nskb->end = ndata + skb->len + newheadroom + newtailroom;
	nskb->tail = ndata + skb->len + newheadroom;
	
	return nskb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r13d
movq %rdi, %r12
movl (%rdi), %r14d
leal (%rbx,%r13), %eax
leal (%r14,%rax), %edi
callq 0x420db0
testq %rax, %rax
je 0x402370
movq %rax, %rbp
movl $0x40, %edi
callq 0x420db0
testq %rax, %rax
je 0x402368
movq %rax, %r15
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movslq %r13d, %rax
movq %rbp, %r13
addq %rax, %r13
movq 0x38(%r12), %rsi
movq %r13, %rdi
movq %r14, %rdx
callq 0x401040
movq %rbp, 0x30(%r15)
movq %r13, 0x38(%r15)
addq %r14, %r13
movslq %ebx, %rax
addq %r13, %rax
movq %rax, 0x28(%r15)
movq %r13, 0x20(%r15)
jmp 0x402373
movq %rbp, %rdi
callq 0x4210f0
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jelaas[P]egetty/skbuff.c
// Function: skb_copy
struct sk_buff *skb_copy(const struct sk_buff *skb)
{
	struct sk_buff *nskb;
	void *ndata;

	ndata = malloc(skb->end - skb->head);
	if(!ndata) return NULL;
	
	nskb = malloc(sizeof(struct sk_buff));
	if(!nskb) {
		free(ndata);
		return NULL;
	}
	memcpy(nskb, skb, sizeof(struct sk_buff));
	memcpy(ndata, skb->head, skb->end - skb->head);
	
	nskb->head = ndata;
	nskb->data = ndata + skb_headroom(skb);
	nskb->end = ndata + (skb->end - skb->head);
	nskb->tail = nskb->data + skb->len;
	
	return nskb;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %r15
movq 0x30(%rdi), %r13
subq %r13, %r15
movq %r15, %rdi
callq 0x420db0
testq %rax, %rax
je 0x402405
movq %rax, %r12
movl $0x40, %edi
callq 0x420db0
testq %rax, %rax
je 0x4023fd
movq %rax, %r14
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x401040
movq %r12, 0x30(%r14)
movl 0x38(%rbx), %eax
subl %r13d, %eax
addq %r12, %rax
movq %rax, 0x38(%r14)
addq %r15, %r12
movq %r12, 0x28(%r14)
movl (%rbx), %ecx
addq %rax, %rcx
movq %rcx, 0x20(%r14)
jmp 0x402408
movq %r12, %rdi
callq 0x4210f0
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/antonblanchard[P]will-it-scale/tests/writeseek1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char buf[BUFLEN];
	char tmpfile[] = "/tmp/willitscale.XXXXXX";
	int fd = mkstemp(tmpfile);

	memset(buf, 0, sizeof(buf));
	assert(fd >= 0);
	unlink(tmpfile);

	while (1) {
		lseek(fd, 0, SEEK_SET);
		assert(write(fd, buf, BUFLEN) == BUFLEN);

		(*iterations)++;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1020, %rsp           # imm = 0x1020
movq %rdi, %rbx
movaps 0x697(%rip), %xmm0      # 0x3320
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movabsq $0x5858585858582e, %rax # imm = 0x5858585858582E
movq %rax, 0x10(%rdi)
callq 0x21d0
movl %eax, %ebp
leaq 0x20(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x2140
testl %ebp, %ebp
js 0x2d2e
movq %rsp, %rdi
callq 0x2080
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2120
leaq 0x20(%rsp), %rsi
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
callq 0x20d0
cmpq $0x1000, %rax           # imm = 0x1000
jne 0x2d0f
leaq 0x20(%rsp), %r14
incq (%rbx)
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2120
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r14, %rsi
callq 0x20d0
cmpq $0x1000, %rax           # imm = 0x1000
je 0x2cea
leaq 0x5e9(%rip), %rdi       # 0x32ff
leaq 0x59c(%rip), %rsi       # 0x32b9
leaq 0x5a8(%rip), %rcx       # 0x32cc
movl $0x17, %edx
callq 0x2130
leaq 0x57c(%rip), %rdi       # 0x32b1
leaq 0x57d(%rip), %rsi       # 0x32b9
leaq 0x589(%rip), %rcx       # 0x32cc
movl $0x12, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O3/lh3[P]partig/gfa-base.c
// Function: gfa_init
gfa_t *gfa_init(void)
{
	gfa_t *g;
	g = (gfa_t*)calloc(1, sizeof(gfa_t));
	g->h_names = kh_init(seg);
	g->h_snames = kh_init(seg);
	return g;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x1, %edi
movl $0x60, %esi
callq 0x1130
movq %rax, %rbx
xorl %r14d, %r14d
movl $0x1, %esi
movl $0x30, %edx
xorl %edi, %edi
callq 0x1730
movq %r14, 0x28(%rax)
movq %rax, 0x18(%rbx)
movl $0x1, %esi
movl $0x30, %edx
xorl %edi, %edi
callq 0x1730
movq %r14, 0x28(%rax)
movq %rax, 0x30(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]partig/gfa-base.c
// Function: gfa_destroy
void gfa_destroy(gfa_t *g)
{
	uint32_t i, j;
	uint64_t k;
	if (g == 0) return;
	kh_destroy(seg, (seghash_t*)g->h_names);
	for (i = 0; i < g->n_seg; ++i) {
		gfa_seg_t *s = &g->seg[i];
		free(s->name);
		free(s->seq);
		free(s->aux.aux);
		if (s->utg) {
			for (j = 0; j < s->utg->n; ++j)
				free(s->utg->name[j]);
			free(s->utg->name);
			free(s->utg->a);
			free(s->utg);
		}
	}
	for (i = 0; i < g->n_sseq; ++i) free(g->sseq[i].name);
	kh_destroy(seg, (seghash_t*)g->h_snames);
	if (g->link_aux)
		for (k = 0; k < g->n_arc; ++k)
			free(g->link_aux[k].aux);
	free(g->idx); free(g->seg); free(g->arc); free(g->link_aux); free(g->sseq);
	free(g);
}

// Assembly:
testq %rdi, %rdi
je 0x2246
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %r14
testq %r14, %r14
je 0x20db
movq 0x18(%r14), %rsi
movq 0x28(%r14), %r15
movq %r15, %rdi
callq 0x17cb
movq 0x10(%r14), %rsi
movq %r15, %rdi
callq 0x17cb
movq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x17cb
movq %r15, %rdi
movq %r14, %rsi
callq 0x17cb
cmpl $0x0, 0x4(%rbx)
je 0x2171
xorl %r14d, %r14d
movq 0x10(%rbx), %r15
movq %r14, %r12
shlq $0x6, %r12
movq 0x18(%r15,%r12), %rdi
callq 0x1040
movq 0x20(%r15,%r12), %rdi
callq 0x1040
movq 0x38(%r15,%r12), %rdi
callq 0x1040
movq 0x28(%r15,%r12), %rax
testq %rax, %rax
je 0x2162
addq %r12, %r15
cmpl $0x0, 0x14(%rax)
je 0x2143
xorl %r12d, %r12d
movq 0x28(%rax), %rax
movq (%rax,%r12,8), %rdi
callq 0x1040
incq %r12
movq 0x28(%r15), %rax
movl 0x14(%rax), %ecx
cmpq %rcx, %r12
jb 0x2127
movq 0x28(%rax), %rdi
callq 0x1040
movq 0x28(%r15), %rax
movq 0x18(%rax), %rdi
callq 0x1040
movq 0x28(%r15), %rdi
callq 0x1040
incq %r14
movl 0x4(%rbx), %eax
cmpq %rax, %r14
jb 0x20e8
cmpl $0x0, 0x24(%rbx)
je 0x2199
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x1040
incq %r15
movl 0x24(%rbx), %eax
addq $0x18, %r14
cmpq %rax, %r15
jb 0x217d
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x21d5
movq 0x18(%r14), %rsi
movq 0x28(%r14), %r15
movq %r15, %rdi
callq 0x17cb
movq 0x10(%r14), %rsi
movq %r15, %rdi
callq 0x17cb
movq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x17cb
movq %r15, %rdi
movq %r14, %rsi
callq 0x17cb
cmpq $0x0, 0x50(%rbx)
je 0x2206
cmpq $0x0, 0x40(%rbx)
je 0x2206
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x50(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x1040
incq %r15
addq $0x10, %r14
cmpq 0x40(%rbx), %r15
jb 0x21ec
movq 0x58(%rbx), %rdi
callq 0x1040
movq 0x10(%rbx), %rdi
callq 0x1040
movq 0x48(%rbx), %rdi
callq 0x1040
movq 0x50(%rbx), %rdi
callq 0x1040
movq 0x28(%rbx), %rdi
callq 0x1040
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1040
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]partig/gfa-base.c
// Function: gfa_add_seg
int32_t gfa_add_seg(gfa_t *g, const char *name)
{
	khint_t k;
	int absent;
	seghash_t *h = (seghash_t*)g->h_names;
	k = kh_put(seg, h, name, &absent);
	if (absent) {
		gfa_seg_t *s;
		if (g->n_seg == g->m_seg) {
			uint32_t old_m = g->m_seg;
			g->m_seg = g->m_seg? g->m_seg<<1 : 16;
			g->seg = (gfa_seg_t*)realloc(g->seg, g->m_seg * sizeof(gfa_seg_t));
			memset(&g->seg[old_m], 0, (g->m_seg - old_m) * sizeof(gfa_seg_t));
		}
		s = &g->seg[g->n_seg++];
		kh_key(h, k) = s->name = gfa_strdup(name);
		s->del = s->len = 0;
		s->snid = s->soff = s->rank = -1;
		kh_val(h, k) = g->n_seg - 1;
	}
	return kh_val(h, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdi), %rbx
leaq 0x14(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x23d5
cmpl $0x0, (%r12)
je 0x2334
movl %eax, 0x4(%rsp)
movl 0x4(%r14), %r13d
cmpl (%r14), %r13d
movq %rbx, 0x8(%rsp)
jne 0x2342
leal (,%r13,2), %eax
testl %r13d, %r13d
movl $0x10, %esi
cmovnel %eax, %esi
movl %esi, (%r14)
movq 0x10(%r14), %rdi
shlq $0x6, %rsi
callq 0x11a0
movq %rax, %r12
movq %rax, 0x10(%r14)
movq %r13, %rdi
shlq $0x6, %rdi
addq %rax, %rdi
movl (%r14), %edx
subl %r13d, %edx
shlq $0x6, %rdx
xorl %esi, %esi
callq 0x1100
movl 0x4(%r14), %r13d
jmp 0x2346
movq 0x20(%rbx), %rdx
movl %eax, %ecx
movl (%rdx,%rcx,4), %eax
jmp 0x23c6
movq 0x10(%r14), %r12
leal 0x1(%r13), %eax
movl %eax, 0x4(%r14)
movl %r13d, %ebx
shlq $0x6, %rbx
movq %r15, %rdi
callq 0x10c0
incl %eax
movslq %eax, %r13
movq %r13, %rdi
callq 0x1190
movq %rax, %rbp
movq %rax, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x1180
movq %rbp, 0x18(%r12,%rbx)
movq 0x8(%rsp), %rdx
movq 0x18(%rdx), %rax
movl 0x4(%rsp), %ecx
movq %rbp, (%rax,%rcx,8)
movl $0x0, (%r12,%rbx)
movzwl 0x6(%r12,%rbx), %eax
shll $0x10, %eax
movl %eax, 0x4(%r12,%rbx)
movl $0xffffffff, 0x10(%r12,%rbx) # imm = 0xFFFFFFFF
movq $-0x1, 0x8(%r12,%rbx)
movl 0x4(%r14), %eax
decl %eax
movq 0x20(%rdx), %rdx
movl %eax, (%rdx,%rcx,4)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]partig/gfa-base.c
// Function: gfa_sseq_add
int32_t gfa_sseq_add(gfa_t *g, const char *sname)
{
	khash_t(seg) *h = (khash_t(seg)*)g->h_snames;
	khint_t k;
	int absent;
	k = kh_put(seg, h, sname, &absent);
	if (absent) {
		gfa_sseq_t *ss;
		if (g->n_sseq == g->m_sseq) GFA_EXPAND(g->sseq, g->m_sseq);
		ss = &g->sseq[g->n_sseq++];
		kh_val(h, k) = g->n_sseq - 1;
		kh_key(h, k) = ss->name = gfa_strdup(sname);
		ss->min = -1, ss->max = -1, ss->rank = -1;
	}
	return kh_val(h, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r13
movq %rdi, %r15
movq 0x30(%rdi), %rbx
leaq 0x4(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x23d5
movl %eax, %ebp
cmpl $0x0, (%r12)
je 0x2654
movl 0x24(%r15), %eax
cmpl 0x20(%r15), %eax
jne 0x2658
movl %eax, %ecx
shrl %ecx
addl %eax, %ecx
testl %eax, %eax
movl $0x10, %eax
cmovnel %ecx, %eax
movl %eax, 0x20(%r15)
movq 0x28(%r15), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
callq 0x11a0
movq %rax, %r12
movq %rax, 0x28(%r15)
movl 0x24(%r15), %eax
jmp 0x265c
movl %ebp, %ebp
jmp 0x26b6
movq 0x28(%r15), %r12
leal 0x1(%rax), %ecx
movl %ecx, 0x24(%r15)
movl %eax, %ecx
leaq (%rcx,%rcx,2), %r14
movq 0x20(%rbx), %rcx
movl %ebp, %ebp
movl %eax, (%rcx,%rbp,4)
movq %r13, %rdi
callq 0x10c0
incl %eax
movslq %eax, %r15
movq %r15, %rdi
callq 0x1190
movq %r13, %rsi
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rdx
callq 0x1180
movq %r13, (%r12,%r14,8)
movq 0x18(%rbx), %rax
movq %r13, (%rax,%rbp,8)
movq $-0x1, 0x8(%r12,%r14,8)
movl $0xffffffff, 0x10(%r12,%r14,8) # imm = 0xFFFFFFFF
movq 0x20(%rbx), %rax
movl (%rax,%rbp,4), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]partig/gfa-base.c
// Function: gfa_sseq_get
int32_t gfa_sseq_get(const gfa_t *g, const char *sname)
{
	khash_t(seg) *h = (khash_t(seg)*)g->h_snames;
	khint_t k;
	k = kh_get(seg, h, sname);
	return k == kh_end(h)? -1 : kh_val(h, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x30(%rdi), %rax
movq %rax, 0x8(%rsp)
movl (%rax), %ecx
testl %ecx, %ecx
je 0x2724
movq %rsi, %r14
leal -0x1(%rcx), %edi
movsbl (%rsi), %r13d
testl %r13d, %r13d
movq %rcx, 0x18(%rsp)
je 0x272c
movb 0x1(%r14), %al
testb %al, %al
je 0x272f
leaq 0x2(%r14), %rcx
movl %r13d, %edx
shll $0x5, %edx
subl %r13d, %edx
movsbl %al, %r13d
addl %edx, %r13d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x2709
jmp 0x272f
xorl %r15d, %r15d
jmp 0x27b7
xorl %r13d, %r13d
andl %edi, %r13d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdx
movl $0x1, %ebx
movl %r13d, %r15d
movl %edi, 0x14(%rsp)
movq %rdx, 0x20(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %r12d
leal (%r15,%r15), %ebp
andl $0x1e, %ebp
movl %r12d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x27a5
testb $0x1, %al
jne 0x2791
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x1140
movq 0x20(%rsp), %rdx
movl 0x14(%rsp), %edi
testl %eax, %eax
je 0x27a5
addl %ebx, %r15d
andl %edi, %r15d
incl %ebx
cmpl %r13d, %r15d
jne 0x274c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x27d0
movl %ebp, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x18(%rsp), %rcx
cmovnel %ecx, %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %r15d
je 0x27d0
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movl %r15d, %ecx
movl (%rax,%rcx,4), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]partig/gfa-base.c
// Function: gfa_name2id
int32_t gfa_name2id(const gfa_t *g, const char *name)
{
	seghash_t *h = (seghash_t*)g->h_names;
	khint_t k;
	k = kh_get(seg, h, name);
	return k == kh_end(h)? -1 : kh_val(h, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x18(%rdi), %rax
movq %rax, 0x8(%rsp)
movl (%rax), %ecx
testl %ecx, %ecx
je 0x28c8
movq %rsi, %r14
leal -0x1(%rcx), %edi
movsbl (%rsi), %r13d
testl %r13d, %r13d
movq %rcx, 0x18(%rsp)
je 0x28d0
movb 0x1(%r14), %al
testb %al, %al
je 0x28d3
leaq 0x2(%r14), %rcx
movl %r13d, %edx
shll $0x5, %edx
subl %r13d, %edx
movsbl %al, %r13d
addl %edx, %r13d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x28ad
jmp 0x28d3
xorl %r15d, %r15d
jmp 0x295b
xorl %r13d, %r13d
andl %edi, %r13d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdx
movl $0x1, %ebx
movl %r13d, %r15d
movl %edi, 0x14(%rsp)
movq %rdx, 0x20(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %r12d
leal (%r15,%r15), %ebp
andl $0x1e, %ebp
movl %r12d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x2949
testb $0x1, %al
jne 0x2935
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x1140
movq 0x20(%rsp), %rdx
movl 0x14(%rsp), %edi
testl %eax, %eax
je 0x2949
addl %ebx, %r15d
andl %edi, %r15d
incl %ebx
cmpl %r13d, %r15d
jne 0x28f0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x2974
movl %ebp, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x18(%rsp), %rcx
cmovnel %ecx, %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %r15d
je 0x2974
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movl %r15d, %ecx
movl (%rax,%rcx,4), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]partig/pdist.c
// Function: rs_sort_mz
void pt_pdopt_init(pt_pdopt_t *opt)
{
	memset(opt, 0, sizeof(pt_pdopt_t));
	opt->k = 51, opt->w = 51, opt->is_hpc = 1;
	opt->max_occ = 20;
	opt->min_cnt = 5;
	opt->min_sim = 0.95;
	opt->diff_thres = 0.5;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movl %ecx, %ebx
movl %edx, %ebp
movl $0x1, %edx
movl %ebp, %ecx
shll %cl, %edx
cmpl $0x8, %ebp
jg 0x7884
movslq %edx, %r14
decl %edx
shlq $0x4, %r14
leaq (%rsp,%r14), %rax
xorl %ecx, %ecx
movq %rdi, 0x8(%rsp,%rcx)
movq %rdi, (%rsp,%rcx)
addq $0x10, %rcx
cmpq %rcx, %r14
jne 0x7724
movl %ebx, %ecx
movslq %edx, %rdx
cmpq %rsi, %rdi
je 0x775f
movq %rdi, %r8
movq (%r8), %r9
shrq %cl, %r9
andq %rdx, %r9
shlq $0x4, %r9
addq $0x10, 0x8(%rsp,%r9)
addq $0x10, %r8
cmpq %rsi, %r8
jne 0x7743
testl %ebp, %ebp
je 0x7785
movl $0x10, %esi
movq -0x8(%rsp,%rsi), %r8
movq %r8, %r9
subq %rdi, %r9
addq %r9, 0x8(%rsp,%rsi)
movq %r8, (%rsp,%rsi)
addq $0x10, %rsi
cmpq %rsi, %r14
jne 0x7768
movq %rsp, %rsi
movq (%rsi), %r9
cmpq 0x8(%rsi), %r9
je 0x77f8
movq (%r9), %r8
movq %r8, %r10
shrq %cl, %r10
andq %rdx, %r10
shlq $0x4, %r10
addq %rsp, %r10
cmpq %rsi, %r10
je 0x77fe
movq 0x8(%r9), %r9
movq %r8, %r11
movq %r9, %r15
movq (%r10), %r12
movq (%r12), %r8
movq 0x8(%r12), %r9
leaq 0x10(%r12), %r13
movq %r13, (%r10)
movq %r11, (%r12)
movq %r15, 0x8(%r12)
movq %r8, %r10
shrq %cl, %r10
andq %rdx, %r10
shlq $0x4, %r10
addq %rsp, %r10
cmpq %rsi, %r10
jne 0x77ad
movq (%rsi), %r10
leaq 0x10(%r10), %r11
movq %r11, (%rsi)
movq %r8, (%r10)
movq %r9, 0x8(%r10)
jmp 0x7805
addq $0x10, %rsi
jmp 0x7805
addq $0x10, %r9
movq %r9, (%rsi)
cmpq %rax, %rsi
jne 0x7788
movq %rdi, (%rsp)
testl %ebp, %ebp
je 0x782d
movl $0x10, %eax
movq -0x8(%rsp,%rax), %rcx
movq %rcx, (%rsp,%rax)
addq $0x10, %rax
cmpq %rax, %r14
jne 0x781b
testl %ebx, %ebx
je 0x7872
xorl %r15d, %r15d
subl %ebp, %ebx
cmovlel %r15d, %ebx
movq (%rsp,%r15), %rdi
movq 0x8(%rsp,%r15), %rsi
movq %rsi, %rax
subq %rdi, %rax
sarq $0x4, %rax
cmpq $0x41, %rax
jl 0x785e
movl %ebp, %edx
movl %ebx, %ecx
callq 0x76ee
jmp 0x7869
cmpq $0x2, %rax
jl 0x7869
callq 0x7694
addq $0x10, %r15
cmpq %r15, %r14
jne 0x783a
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1875(%rip), %rdi      # 0x9100
leaq 0x1e36(%rip), %rsi      # 0x96c8
leaq 0x1e37(%rip), %rcx      # 0x96d0
movl $0x7, %edx
callq 0x10e0
// File: /workspace/github_c_makefile_star2_O3/lh3[P]partig/pdist.c
// Function: pt_lis_64
int32_t pt_lis_64(int32_t n, const uint64_t *a, int32_t *b)
{
	int32_t i, k, L = 0, *M, *P = b;
	PT_MALLOC(M, n+1);
	for (i = 0; i < n; ++i) {
		int32_t lo = 1, hi = L, newL;
		while (lo <= hi) {
			int32_t mid = (lo + hi + 1) >> 1;
			if (a[M[mid]] < a[i]) lo = mid + 1;
			else hi = mid - 1;
		}
		newL = lo, P[i] = M[newL - 1], M[newL] = i;
		if (newL > L) L = newL;
	}
	k = M[L];
	memcpy(M, P, n * sizeof(int32_t));
	for (i = L - 1; i >= 0; --i) b[i] = k, k = M[k];
	free(M);
	return L;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movslq %edi, %r12
leaq 0x4(,%r12,4), %rdi
callq 0x1190
movq %rax, %rbx
testl %r12d, %r12d
jle 0x79ad
movl %ebp, %edx
xorl %eax, %eax
xorl %ebp, %ebp
testl %ebp, %ebp
jle 0x7956
movq (%r15,%rax,8), %rsi
movl $0x1, %ecx
movl %ebp, %edi
leal (%rcx,%rdi), %r8d
incl %r8d
sarl %r8d
movslq %r8d, %r9
movslq (%rbx,%r9,4), %r9
cmpq %rsi, (%r15,%r9,8)
jb 0x794a
decl %r8d
movl %r8d, %edi
jmp 0x7950
incl %r8d
movl %r8d, %ecx
cmpl %edi, %ecx
jle 0x792b
jmp 0x795b
movl $0x1, %ecx
movslq %ecx, %rcx
movl -0x4(%rbx,%rcx,4), %esi
movl %esi, (%r14,%rax,4)
movl %eax, (%rbx,%rcx,4)
cmpl %ebp, %ecx
cmovgl %ecx, %ebp
incq %rax
cmpq %rdx, %rax
jne 0x791c
movslq %ebp, %r12
movl (%rbx,%r12,4), %r15d
shlq $0x2, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1180
testl %r12d, %r12d
jle 0x79af
movl %ebp, %eax
incq %rax
movl %r15d, -0x8(%r14,%rax,4)
movslq %r15d, %rcx
movl (%rbx,%rcx,4), %r15d
decq %rax
cmpq $0x1, %rax
ja 0x7996
jmp 0x79af
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x1040
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]partig/pdist.c
// Function: pt_pdist_symm
uint32_t pt_pdist_symm(pt_match_t *ma)
{
	uint8_t *del;
	uint32_t i, k, n = 0;
	PT_CALLOC(del, ma->n_ma);
	for (i = 0; i < ma->n_ma; ++i) {
		pt_match1_t *m = &ma->ma[i];
		if (m->sid[0] == m->sid[1]) del[i] = 1, ++n;
		else if (!pt_pdist_has_rev(ma, m->sid[1], m->sid[0], m->rev))
			del[i] = 1, ++n;
	}
	if (n > 0) {
		for (i = k = 0; i < ma->n_ma; ++i)
			if (!del[i]) ma->ma[k++] = ma->ma[i];
		ma->n_ma = k;
		pt_pdist_idx(ma);
	}
	free(del);
	if (pt_verbose >= 3)
		fprintf(stderr, "[%s::%.3f] dropped %d one directional edges; %d remain\n", __func__, pt_realtime(), n, ma->n_ma);
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %r15d
movl $0x1, %esi
movq %r15, %rdi
callq 0x1130
movq %rax, %r14
testq %r15, %r15
je 0x7a99
movq 0x18(%rbx), %rax
leaq 0xc(%rax), %rcx
xorl %edx, %edx
xorl %ebp, %ebp
leaq (%rdx,%rdx,2), %r8
movl (%rax,%r8,8), %esi
movl 0x4(%rax,%r8,8), %edi
cmpl %edi, %esi
je 0x7a41
movq 0x8(%rbx), %r9
movq (%r9,%rdi,8), %rdi
movq %rdi, %r9
shrq $0x20, %r9
leal (%r9,%rdi), %r10d
cmpl %r9d, %r10d
jbe 0x7a41
leaq (%rax,%r8,8), %r8
movl 0xc(%r8), %r8d
leaq (%r9,%r9,2), %r9
leaq (%rcx,%r9,8), %r9
cmpl %esi, -0x8(%r9)
jne 0x7a39
cmpl %r8d, (%r9)
je 0x7a48
addq $0x18, %r9
decl %edi
jne 0x7a2e
movb $0x1, (%r14,%rdx)
incl %ebp
incq %rdx
cmpq %r15, %rdx
jne 0x79f5
testl %ebp, %ebp
je 0x7a99
testl %r15d, %r15d
je 0x7a9d
xorl %eax, %eax
xorl %edx, %edx
xorl %ecx, %ecx
cmpb $0x0, (%r14,%rdx)
jne 0x7a88
movq 0x18(%rbx), %rsi
movl %ecx, %edi
incl %ecx
leaq (%rdi,%rdi,2), %rdi
movq 0x10(%rsi,%rax), %r8
movq %r8, 0x10(%rsi,%rdi,8)
movups (%rsi,%rax), %xmm0
movups %xmm0, (%rsi,%rdi,8)
movl 0x4(%rbx), %r15d
incq %rdx
movl %r15d, %esi
addq $0x18, %rax
cmpq %rsi, %rdx
jb 0x7a5f
jmp 0x7a9f
xorl %ebp, %ebp
jmp 0x7aaa
xorl %ecx, %ecx
movl %ecx, 0x4(%rbx)
movq %rbx, %rdi
callq 0x7afa
movq %r14, %rdi
callq 0x1040
leaq 0x477f(%rip), %rax      # 0xc238
cmpl $0x3, (%rax)
jae 0x7acb
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x4526(%rip), %rax      # 0xbff8
movq (%rax), %r14
callq 0x6bde
movl 0x4(%rbx), %r8d
leaq 0x1c1d(%rip), %rsi      # 0x9702
leaq 0x1c4e(%rip), %rdx      # 0x973a
movq %r14, %rdi
movl %ebp, %ecx
movb $0x1, %al
callq 0x1160
jmp 0x7abe
// File: /workspace/github_c_makefile_star2_O3/lh3[P]partig/pdist.c
// Function: pt_pdist_idx
static void pt_pdist_idx(pt_match_t *ma)
{
	uint32_t st, i;
	free(ma->idx);
	PT_CALLOC(ma->idx, ma->n_seg);
	for (st = 0, i = 1; i <= ma->n_ma; ++i)
		if (i == ma->n_ma || ma->ma[i].sid[0] != ma->ma[st].sid[0])
			ma->idx[ma->ma[st].sid[0]] = (uint64_t)st << 32 | (i - st), st = i;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x1040
movl (%rbx), %edi
movl $0x8, %esi
callq 0x1130
movq %rax, 0x8(%rbx)
movl 0x4(%rbx), %ecx
testq %rcx, %rcx
je 0x7b7c
leal 0x1(%rcx), %esi
cmpl $0x3, %esi
movl $0x2, %edx
cmovael %esi, %edx
movq 0x18(%rbx), %rsi
leaq 0x18(%rsi), %rdi
xorl %r9d, %r9d
movl $0x1, %r8d
movl %r9d, %r10d
leaq (%r10,%r10,2), %r11
cmpq %r8, %rcx
jne 0x7b50
movl (%rsi,%r11,8), %r11d
jmp 0x7b59
movl (%rsi,%r11,8), %r11d
cmpl %r11d, (%rdi)
je 0x7b70
shlq $0x20, %r10
movl %r8d, %ebx
subl %r9d, %ebx
orq %r10, %rbx
movl %r11d, %r9d
movq %rbx, (%rax,%r9,8)
movl %r8d, %r9d
incq %r8
addq $0x18, %rdi
cmpq %r8, %rdx
jne 0x7b3e
popq %rbx
retq