LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/stats.c
// Function: print_count
void print_count(uint64_t val, const struct print_options *opts)
{
	unsigned int base = opts->binary_prefix ? 1024 : 1000;
	const char *unit_str = unit_names[opts->unit];
	const char prefixes[] = " KMGT";
	const char *prefix = &prefixes[0];
	double dval;

	if (opts->exact) {
		printf("%*" PRIu64 " %s", opts->width, val, unit_str);
		return;
	}
	if (val < 20 * base) {
		printf("%5" PRIu64 "    %s", val, unit_str);
		return;
	}

	dval = val / base;
	prefix++;
	while ((dval >= 20 * base) && *prefix) {
		dval /= base;
		prefix++;
	}
	printf("%7.1lf %c%s", dval, *prefix, unit_str);

}

// Assembly:
movq %rdi, %rdx
cmpb $0x0, 0x9(%rsi)
movl $0x400, %eax            # imm = 0x400
movl $0x3e8, %edi            # imm = 0x3E8
cmovnel %eax, %edi
movl (%rsi), %eax
leaq 0x4b19(%rip), %rcx      # 0x8db0
movq (%rcx,%rax,8), %rcx
cmpb $0x1, 0x8(%rsi)
jne 0x42b2
movl 0x4(%rsi), %esi
leaq 0x1e15(%rip), %rdi      # 0x60c0
xorl %eax, %eax
jmp 0x2120
leal (,%rdi,4), %eax
leal (%rax,%rax,4), %esi
cmpq %rdx, %rsi
jbe 0x42d5
leaq 0x1e00(%rip), %rdi      # 0x60c8
movq %rdx, %rsi
movq %rcx, %rdx
xorl %eax, %eax
jmp 0x2120
movl %edi, %r8d
movq %rdx, %rax
xorl %edx, %edx
divq %r8
cvtsi2sd %rax, %xmm0
cvtsi2sd %esi, %xmm1
ucomisd %xmm1, %xmm0
jae 0x42f8
leaq 0x1dea(%rip), %rax      # 0x60e0
jmp 0x4325
cvtsi2sd %edi, %xmm2
xorl %edx, %edx
leaq 0x1ddf(%rip), %rax      # 0x60e4
cmpq $0x4, %rdx
je 0x4325
divsd %xmm2, %xmm0
incq %rdx
ucomisd %xmm1, %xmm0
jae 0x4305
leaq 0x1dc0(%rip), %rax      # 0x60df
addq %rdx, %rax
incq %rax
movsbl (%rax), %esi
leaq 0x1da4(%rip), %rdi      # 0x60d3
movq %rcx, %rdx
movb $0x1, %al
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/stats.c
// Function: print_rate
void print_rate(double val, const struct print_options *opts)
{
	unsigned int base = opts->binary_prefix ? 1024 : 1000;
	const char *unit_str = unit_names[opts->unit];
	const char prefixes[] = " KMGT";
	const char *prefix = &prefixes[0];

	if (opts->exact) {
		printf("%*.1lf %s/s", opts->width, val, unit_str);
		return;
	}

	while (val >= 20000 && *prefix) {
		val /= base;
		prefix++;
	}
	printf("%7.1lf %c%s/s", val, *prefix, unit_str);

}

// Assembly:
movl (%rdi), %eax
leaq 0x4a6e(%rip), %rcx      # 0x8db0
movq (%rcx,%rax,8), %rdx
cmpb $0x0, 0x8(%rdi)
je 0x435d
movl 0x4(%rdi), %esi
leaq 0x1d8f(%rip), %rdi      # 0x60e5
movb $0x1, %al
jmp 0x2120
ucomisd 0x1d1b(%rip), %xmm0     # 0x6080
jae 0x4370
leaq 0x1d71(%rip), %rax      # 0x60df
jmp 0x43b6
cmpb $0x0, 0x9(%rdi)
jne 0x4380
movsd 0x1d12(%rip), %xmm1     # 0x6090
jmp 0x4388
movsd 0x1d00(%rip), %xmm1     # 0x6088
xorl %ecx, %ecx
leaq 0x1d53(%rip), %rax      # 0x60e4
movsd 0x1ce7(%rip), %xmm2     # 0x6080
cmpq $-0x5, %rcx
je 0x43b6
divsd %xmm1, %xmm0
decq %rcx
ucomisd %xmm2, %xmm0
jae 0x4399
leaq 0x1d2c(%rip), %rax      # 0x60df
subq %rcx, %rax
movsbl (%rax), %esi
leaq 0x1d31(%rip), %rdi      # 0x60f1
movb $0x1, %al
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/stats.c
// Function: xfer_stats_print_raw
void xfer_stats_print_raw(const struct xfer_stats *stats, unsigned int id)
{
	if (id == XFER_STATS_TOTAL)
		fputs("total    ", stdout);
	else
		printf("%-8u ", id);

	xfer_stats_1_print(&stats->rx);
	fputs("    ", stdout);
	xfer_stats_1_print(&stats->tx);
	putchar('\n');
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $-0x1, %esi
je 0x4456
leaq 0x1cf3(%rip), %rdi      # 0x6140
xorl %eax, %eax
callq 0x2120
jmp 0x446c
movq 0x4b73(%rip), %rax      # 0x8fd0
movq (%rax), %rsi
leaq 0x1ccf(%rip), %rdi      # 0x6136
callq 0x2150
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rcx
leaq 0x1d55(%rip), %r14      # 0x61d3
movq %r14, %rdi
xorl %eax, %eax
callq 0x2120
movq 0x4b41(%rip), %rax      # 0x8fd0
movq (%rax), %rsi
leaq 0x1cd7(%rip), %rdi      # 0x6170
callq 0x2150
movq 0x18(%rbx), %rdx
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2120
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/stats.c
// Function: xfer_stats_thread_footer
void xfer_stats_thread_footer(double sum, double sum_sqr, unsigned int n,
			      const struct print_options *opts)
{
	double avg, mdev;

	avg = sum / n;
	mdev = mdev_n(sum, sum_sqr, n);
	fputs("thread average ", stdout);
	print_rate(avg, opts);
	fputs(", mdev ", stdout);
	print_rate(mdev, opts);
	printf(" (%.1lf%%)\n", 100 * mdev / avg);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movl %edi, %eax
cvtsi2sd %rax, %xmm2
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm0
mulsd %xmm2, %xmm1
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x44f9
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
jmp 0x4518
movapd %xmm1, %xmm0
movapd %xmm2, (%rsp)
movapd %xmm3, 0x10(%rsp)
callq 0x2310
movapd 0x10(%rsp), %xmm3
movapd (%rsp), %xmm2
unpcklpd %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
divpd %xmm2, %xmm0
movapd %xmm0, (%rsp)
movq 0x4aa0(%rip), %r14      # 0x8fd0
movq (%r14), %rsi
leaq 0x1c0c(%rip), %rdi      # 0x6146
callq 0x2150
movaps (%rsp), %xmm0
movhlps %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movaps %xmm0, 0x10(%rsp)
movq %rbx, %rdi
callq 0x4339
movq (%r14), %rsi
leaq 0x1bf9(%rip), %rdi      # 0x6156
callq 0x2150
movaps (%rsp), %xmm0
movq %rbx, %rdi
callq 0x4339
movapd (%rsp), %xmm0
mulsd 0xaad(%rip), %xmm0      # 0x5028
divsd 0x10(%rsp), %xmm0
leaq 0x1bd6(%rip), %rdi      # 0x615e
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r14
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O3/kobolt[P]curses-collection/invaders/loop.c
// Function: loop
void loop(void)
{
  long cycle;
  iface_action_t action;
  
  game_init();
  iface_init();

  iface_redraw_screen();
  for (cycle = 0;; cycle++) {

    action = iface_get_action();

    /* Perform player action. */
    switch (action) {
    case ACTION_EXIT:
      iface_set_end_msg("Player gave up!");
      return;

    case ACTION_RESIZE:
      if (iface_invalid_size()) {
        iface_set_end_msg("Invalid resize of terminal!");
        return;
      }
      break;

    case ACTION_SHOOT:
      game_fire_shot();
      break;

    case ACTION_MOVE_LEFT:
      game_state.player_pos--;
      if (game_state.player_pos < 2)
        game_state.player_pos = 2;
      break;

    case ACTION_MOVE_RIGHT:
      game_state.player_pos++;
      if (game_state.player_pos > (GAME_MAP_WIDTH - 3))
        game_state.player_pos = GAME_MAP_WIDTH - 3;
      break;

    case ACTION_NONE:
      break;
    }

    if (game_handle_invaders(cycle)) {
      iface_flash_screen();
      iface_set_end_msg("Player could not stop the invaders in time!");
      return;
    }

    if (game_handle_shot())
      iface_flash_screen();

    if (game_handle_bombs()) {
      iface_flash_screen();
      iface_set_end_msg("Player died from an invader's bomb!");
      return;
    }

    if (game_invaders_alive() == 0)
      break; /* Won. */

    iface_redraw_screen();

    usleep(50000);
  }

  iface_set_end_msg("Success! Invader attack has been stopped!");
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x1a9c
callq 0x13b8
callq 0x15cf
xorl %r14d, %r14d
leaq 0x1d55(%rip), %rbx      # 0x3018
leaq 0x1d7a(%rip), %r15      # 0x3044
leaq 0x1d33(%rip), %r12      # 0x3004
leaq 0x3e68(%rip), %r13      # 0x5140
callq 0x1543
decl %eax
cmpl $0x4, %eax
ja 0x132f
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
callq 0x14fb
testl %eax, %eax
je 0x132f
jmp 0x13a0
movzwl 0xa(%r13), %eax
incl %eax
cmpw $0x4d, %ax
movl $0x4d, %ecx
cmovgel %ecx, %eax
jmp 0x132a
callq 0x1b33
jmp 0x132f
movzwl 0xa(%r13), %eax
decl %eax
cmpw $0x3, %ax
movl $0x2, %ecx
cmovll %ecx, %eax
movw %ax, 0xa(%r13)
movq %r14, %rdi
callq 0x1b5a
testl %eax, %eax
jne 0x1379
callq 0x1d69
testl %eax, %eax
je 0x1349
callq 0x1a92
callq 0x1eec
testl %eax, %eax
jne 0x1372
callq 0x1b12
testl %eax, %eax
je 0x1383
callq 0x15cf
movl $0xc350, %edi           # imm = 0xC350
callq 0x1190
incq %r14
jmp 0x12d8
leaq 0x1cf7(%rip), %r15      # 0x3070
callq 0x1a92
movq %r15, %rbx
jmp 0x138a
leaq 0x1d0a(%rip), %rbx      # 0x3094
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x152a
leaq 0x1c81(%rip), %rbx      # 0x3028
jmp 0x138a
// File: /workspace/github_c_makefile_star2_O3/kobolt[P]curses-collection/invaders/iface.c
// Function: iface_init
void iface_init(void)
{
  initscr();
  atexit(iface_exit_handler);
  noecho();
  keypad(stdscr, TRUE);
  timeout(0); /* Non-blocking mode */

  if (iface_invalid_size()) {
    strncpy(iface_end_msg, 
      "Invalid size of terminal. (Must be atleast 80x24.)", IFACE_END_MSG_MAX);
    exit(0);
  }

  strncpy(iface_end_msg, "Abnormal termination.", IFACE_END_MSG_MAX);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x1080
leaq 0x7b(%rip), %rdi        # 0x1445
callq 0x20d0
callq 0x1060
movq 0x3c05(%rip), %rbx      # 0x4fe0
movq (%rbx), %rdi
movl $0x1, %esi
callq 0x10a0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x10e0
movq (%rbx), %rax
testq %rax, %rax
je 0x1426
cmpw $0x17, 0x4(%rax)
jl 0x1426
cmpw $0x4e, 0x6(%rax)
jle 0x1426
leaq 0x3ce1(%rip), %rdi      # 0x50f0
leaq 0x1d65(%rip), %rsi      # 0x317b
movl $0x50, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x10d0
leaq 0x3cc3(%rip), %rdi      # 0x50f0
leaq 0x1d98(%rip), %rsi      # 0x31cc
movl $0x50, %edx
callq 0x10d0
xorl %edi, %edi
callq 0x1140
// File: /workspace/github_c_makefile_star2_O3/kobolt[P]curses-collection/invaders/iface.c
// Function: iface_exit_handler
static void iface_exit_handler(void)
{
  char *rating;

  if (game_state.score >= 3000)
    rating = "Perfect";
  else if (game_state.score > 2500)
    rating = "Very Good";
  else if (game_state.score > 2000)
    rating = "Good";
  else if (game_state.score > 1000)
    rating = "Mediocre";
  else if (game_state.score > 0)
    rating = "Poor";
  else
    rating = "Horrible";

  endwin();
  printf("\n%s\n", iface_end_msg);
  printf("%d invaders survived, and %d shots were wasted.\n",
    game_invaders_alive(), game_state.wasted_shots);
  printf("Score: %ld (%s)\n", game_state.score, rating);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x3ced(%rip), %r14      # 0x5140
movq (%r14), %rax
cmpq $0xbb7, %rax            # imm = 0xBB7
jle 0x1467
leaq 0x1ca6(%rip), %rbx      # 0x310b
jmp 0x14af
cmpq $0x9c4, %rax            # imm = 0x9C4
jle 0x1478
leaq 0x1c9d(%rip), %rbx      # 0x3113
jmp 0x14af
cmpq $0x7d0, %rax            # imm = 0x7D0
jle 0x1489
leaq 0x1c91(%rip), %rbx      # 0x3118
jmp 0x14af
cmpq $0x3e8, %rax            # imm = 0x3E8
jle 0x149a
leaq 0x1c85(%rip), %rbx      # 0x311d
jmp 0x14af
testq %rax, %rax
leaq 0x1c82(%rip), %rax      # 0x3126
leaq 0x1c80(%rip), %rbx      # 0x312b
cmovgq %rax, %rbx
callq 0x1150
leaq 0x1c79(%rip), %rdi      # 0x3134
leaq 0x3c2e(%rip), %rsi      # 0x50f0
xorl %eax, %eax
callq 0x1070
callq 0x1b12
movswl 0x8(%r14), %edx
leaq 0x1c5f(%rip), %rdi      # 0x3139
movl %eax, %esi
xorl %eax, %eax
callq 0x1070
movq (%r14), %rsi
leaq 0x1c7d(%rip), %rdi      # 0x316a
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O3/kobolt[P]curses-collection/invaders/iface.c
// Function: iface_invalid_size
int iface_invalid_size(void)
{
  int maxy, maxx;

  getmaxyx(stdscr, maxy, maxx);

  if (maxy < GAME_MAP_HEIGHT)
    return 1;
  else if (maxx < GAME_MAP_WIDTH)
    return 1;
  else
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x3ada(%rip), %rax      # 0x4fe0
movq (%rax), %rcx
testq %rcx, %rcx
je 0x151f
xorl %eax, %eax
cmpw $0x4f, 0x6(%rcx)
setl %dl
cmpw $0x16, 0x4(%rcx)
jg 0x1526
movl $0x1, %eax
jmp 0x1528
movb %dl, %al
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/kobolt[P]curses-collection/invaders/iface.c
// Function: iface_get_action
iface_action_t iface_get_action(void)
{
  int c;
  iface_action_t action;

  action = ACTION_NONE; /* Default. */

  /* Read character buffer until empty. */
  while ((c = getch()) != ERR) {
    switch (c) {
    case KEY_RESIZE:
      return ACTION_RESIZE;
    case ' ':
    case KEY_UP:
      action = ACTION_SHOOT;
      break;
    case KEY_LEFT:
      action = ACTION_MOVE_LEFT;
      break;
    case KEY_RIGHT:
      action = ACTION_MOVE_RIGHT;
      break;
    case 'q':
    case 'Q':
    case '\e':
      return ACTION_EXIT;
    default:
      break;
    }
  }

  return action;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %ebx, %ebx
movq 0x3a8d(%rip), %r14      # 0x4fe0
movq (%r14), %rdi
callq 0x1050
cmpl $0x70, %eax
jle 0x1583
cmpl $0x103, %eax            # imm = 0x103
jle 0x1594
cmpl $0x19a, %eax            # imm = 0x19A
je 0x15c3
cmpl $0x105, %eax            # imm = 0x105
je 0x15b5
cmpl $0x104, %eax            # imm = 0x104
jne 0x1553
movl $0x3, %ebx
jmp 0x1553
cmpl $0x1f, %eax
jg 0x15a2
cmpl $-0x1, %eax
je 0x15c8
cmpl $0x1b, %eax
jne 0x1553
jmp 0x15bc
cmpl $0x71, %eax
je 0x15bc
cmpl $0x103, %eax            # imm = 0x103
jne 0x1553
jmp 0x15ae
cmpl $0x20, %eax
je 0x15ae
cmpl $0x51, %eax
jne 0x1553
jmp 0x15bc
movl $0x5, %ebx
jmp 0x1553
movl $0x4, %ebx
jmp 0x1553
movl $0x1, %ebx
jmp 0x15c8
movl $0x2, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/garbeam[P]st/st.c
// Function: ttyread
size_t
ttyread(void)
{
	static char buf[BUFSIZ];
	static int buflen = 0;
	int written;
	int ret;

	/* append read bytes to unprocessed bytes */
	if ((ret = read(cmdfd, buf+buflen, LEN(buf)-buflen)) < 0)
		die("couldn't read from shell: %s\n", strerror(errno));
	buflen += ret;

	written = twrite(buf, buflen, 0);
	buflen -= written;
	/* keep any uncomplete utf8 char for the next call */
	if (buflen > 0)
		memmove(buf, buf + written, buflen);

	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0xecd1(%rip), %edi      # 0x15778
movslq 0x10cd2(%rip), %rax     # 0x17780
leaq 0xeccb(%rip), %rsi      # 0x15780
addq %rax, %rsi
movl $0x2000, %edx           # imm = 0x2000
subq %rax, %rdx
callq 0x51c0
movq %rax, %rbx
testl %ebx, %ebx
js 0x6b1c
movl 0x10cae(%rip), %esi     # 0x17780
addl %ebx, %esi
movl %esi, 0x10ca6(%rip)     # 0x17780
leaq 0xec9f(%rip), %r14      # 0x15780
movq %r14, %rdi
xorl %edx, %edx
callq 0x6b39
movl 0x10c8f(%rip), %ecx     # 0x17780
subl %eax, %ecx
movl %ecx, 0x10c87(%rip)     # 0x17780
jle 0x6b0b
movslq %eax, %rsi
addq %r14, %rsi
movl %ecx, %edx
movq %r14, %rdi
callq 0x54d0
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x5560
movl (%rax), %edi
callq 0x5420
leaq 0x7b06(%rip), %rdi      # 0xe635
movq %rax, %rsi
xorl %eax, %eax
callq 0x5e06
// File: /workspace/github_c_makefile_star2_O3/garbeam[P]st/st.c
// Function: draw
void
draw(void)
{
	int cx = term.c.x;

	if (!xstartdraw())
		return;

	/* adjust cursor position */
	LIMIT(term.ocx, 0, term.col-1);
	LIMIT(term.ocy, 0, term.row-1);
	if (term.line[term.ocy][term.ocx].mode & ATTR_WDUMMY)
		term.ocx--;
	if (term.line[term.c.y][cx].mode & ATTR_WDUMMY)
		cx--;

	drawregion(0, 0, term.col, term.row);
	xdrawcursor(cx, term.c.y, term.line[term.c.y][cx],
			term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
	term.ocx = cx, term.ocy = term.c.y;
	xfinishdraw();
	xximspot(term.ocx, term.ocy);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movslq 0xdda3(%rip), %rbx      # 0x15740
callq 0xa570
testl %eax, %eax
je 0x7b12
movl 0xdd9c(%rip), %ecx      # 0x1574c
xorl %r9d, %r9d
movl $0x0, %eax
testl %ecx, %ecx
js 0x79c9
movl 0xdd52(%rip), %eax      # 0x15714
decl %eax
cmpl %eax, %ecx
cmovll %ecx, %eax
movl %eax, 0xdd7d(%rip)      # 0x1574c
movl 0xdd7b(%rip), %ecx      # 0x15750
testl %ecx, %ecx
js 0x79ea
movl 0xdd30(%rip), %r9d      # 0x15710
decl %r9d
cmpl %r9d, %ecx
cmovll %ecx, %r9d
movl %r9d, 0xdd5f(%rip)      # 0x15750
movq 0xdd20(%rip), %rcx      # 0x15718
movslq %r9d, %rdx
movq (%rcx,%rdx,8), %rdi
movslq %eax, %rdx
shlq $0x4, %rdx
testb $0x4, 0x5(%rdi,%rdx)
je 0x7a15
decl %eax
movl %eax, 0xdd37(%rip)      # 0x1574c
movslq 0xdd28(%rip), %rsi      # 0x15744
movq (%rcx,%rsi,8), %rcx
movq %rbx, %rdx
shlq $0x4, %rdx
movl 0x4(%rcx,%rdx), %edx
shll $0x5, %edx
movswl %dx, %ebp
sarl $0xf, %ebp
addl %ebx, %ebp
movslq 0xdcd3(%rip), %r15      # 0x15710
testq %r15, %r15
jle 0x7aaa
movl 0xdccc(%rip), %ebx      # 0x15714
movq 0xdcd9(%rip), %rax      # 0x15728
xorl %r14d, %r14d
cmpl $0x0, (%rax,%r14,4)
je 0x7a7f
movl $0x0, (%rax,%r14,4)
movq 0xdcb0(%rip), %rax      # 0x15718
movq (%rax,%r14,8), %rdi
xorl %esi, %esi
movl %r14d, %edx
movl %ebx, %ecx
callq 0xa57a
movq 0xdca9(%rip), %rax      # 0x15728
incq %r14
cmpq %r14, %r15
jne 0x7a52
movslq 0xdcb6(%rip), %rsi      # 0x15744
movq 0xdc83(%rip), %rdx      # 0x15718
movq (%rdx,%rsi,8), %rcx
movl 0xdcad(%rip), %eax      # 0x1574c
movslq 0xdcaa(%rip), %r9       # 0x15750
movq (%rdx,%r9,8), %rdi
movslq %ebp, %rbx
movq %rbx, %r10
shlq $0x4, %r10
movslq %eax, %r8
movq %r8, %rax
shlq $0x4, %rax
movq (%rcx,%r10), %rdx
movq 0x8(%rcx,%r10), %rcx
movups (%rdi,%rax), %xmm0
movaps %xmm0, 0x10(%rsp)
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %ebx, %edi
callq 0xa1f7
movl %ebx, 0xdc66(%rip)      # 0x1574c
movl 0xdc58(%rip), %eax      # 0x15744
movl %eax, 0xdc5e(%rip)      # 0x15750
callq 0xb139
movl 0xdc4f(%rip), %edi      # 0x1574c
movl 0xdc4d(%rip), %esi      # 0x15750
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb1ba
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/garbeam[P]st/st.c
// Function: base64dec
char *
base64dec(const char *src)
{
	size_t in_len = strlen(src);
	char *result, *dst;

	if (in_len % 4)
		in_len += 4 - (in_len % 4);
	result = dst = xmalloc(in_len / 4 * 3 + 1);
	while (*src) {
		int a = base64_digits[(unsigned char) base64dec_getc(&src)];
		int b = base64_digits[(unsigned char) base64dec_getc(&src)];
		int c = base64_digits[(unsigned char) base64dec_getc(&src)];
		int d = base64_digits[(unsigned char) base64dec_getc(&src)];

		*dst++ = (a << 2) | ((b & 0x30) >> 4);
		if (c == -1)
			break;
		*dst++ = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2);
		if (d == -1)
			break;
		*dst++ = ((c & 0x03) << 6) | d;
	}
	*dst = '\0';
	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq %rdi, 0x10(%rsp)
callq 0x5340
addq $0x3, %rax
shrq $0x2, %rax
leaq (%rax,%rax,2), %rdi
incq %rdi
callq 0x5ddc
cmpb $0x0, (%r14)
movq %rax, %r15
je 0x9549
movq %rax, 0x8(%rsp)
movq %rax, %r15
incq %r15
leaq 0x10(%rsp), %r14
leaq 0x4feb(%rip), %r12      # 0xe4a0
movq %r14, %rdi
callq 0x955c
movzbl %al, %eax
movb (%rax,%r12), %bl
movq %r14, %rdi
callq 0x955c
movzbl %al, %eax
movb (%rax,%r12), %r13b
movq %r14, %rdi
callq 0x955c
movzbl %al, %eax
movb (%rax,%r12), %bpl
movq %r14, %rdi
callq 0x955c
movzbl %al, %eax
movb (%rax,%r12), %al
shlb $0x2, %bl
movl %r13d, %ecx
shrb $0x4, %cl
andb $0x3, %cl
orb %bl, %cl
movb %cl, -0x1(%r15)
cmpb $-0x1, %bpl
je 0x9544
shlb $0x4, %r13b
movl %ebp, %ecx
shrb $0x2, %cl
andb $0xf, %cl
orb %r13b, %cl
movb %cl, (%r15)
cmpb $-0x1, %al
je 0x9541
shlb $0x6, %bpl
orb %bpl, %al
movb %al, 0x1(%r15)
movq 0x10(%rsp), %rax
addq $0x3, %r15
cmpb $0x0, (%rax)
jne 0x94b5
decq %r15
jmp 0x9544
incq %r15
movq 0x8(%rsp), %rax
movb $0x0, (%r15)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/garbeam[P]st/st.c
// Function: selscroll
void
selscroll(int orig, int n)
{
	if (sel.ob.x == -1)
		return;

	if (BETWEEN(sel.ob.y, orig, term.bot) || BETWEEN(sel.oe.y, orig, term.bot)) {
		if ((sel.ob.y += n) > term.bot || (sel.oe.y += n) < term.top) {
			selclear();
			return;
		}
		if (sel.type == SEL_RECTANGULAR) {
			if (sel.ob.y < term.top)
				sel.ob.y = term.top;
			if (sel.oe.y > term.bot)
				sel.oe.y = term.bot;
		} else {
			if (sel.ob.y < term.top) {
				sel.ob.y = term.top;
				sel.ob.x = 0;
			}
			if (sel.oe.y > term.bot) {
				sel.oe.y = term.bot;
				sel.oe.x = term.col;
			}
		}
		selnormalize();
	}
}

// Assembly:
cmpl $-0x1, 0xba13(%rip)     # 0x156fc
je 0x9d21
movl 0xba0f(%rip), %ecx      # 0x15700
cmpl %edi, %ecx
setl %dl
movl 0xba5c(%rip), %eax      # 0x15758
cmpl %eax, %ecx
setg %r8b
orb %dl, %r8b
cmpb $0x1, %r8b
jne 0x9d22
movl 0xb9f7(%rip), %edx      # 0x15708
cmpl %edi, %edx
setl %dil
cmpl %eax, %edx
setg %dl
orb %dil, %dl
je 0x9d22
retq
addl %esi, %ecx
movl %ecx, 0xb9d6(%rip)      # 0x15700
cmpl %eax, %ecx
jg 0x9d44
addl 0xb9d4(%rip), %esi      # 0x15708
movl %esi, 0xb9ce(%rip)      # 0x15708
movl 0xba14(%rip), %edx      # 0x15754
cmpl %edx, %esi
jge 0x9d69
movl $0x0, 0xb992(%rip)      # 0x156e0
movl $0xffffffff, 0xb9a4(%rip) # imm = 0xFFFFFFFF
movl 0xb992(%rip), %edi      # 0x156f0
movl 0xb994(%rip), %esi      # 0x156f8
jmp 0x615b
cmpl $0x2, 0xb974(%rip)      # 0x156e4
jne 0x9d8f
cmpl %edx, %ecx
jge 0x9d7c
movl %edx, 0xb984(%rip)      # 0x15700
cmpl %eax, %esi
jle 0x605f
movl %eax, 0xb97e(%rip)      # 0x15708
jmp 0x605f
cmpl %edx, %ecx
jge 0x9da3
movl %edx, 0xb967(%rip)      # 0x15700
movl $0x0, 0xb959(%rip)      # 0x156fc
cmpl %eax, %esi
jle 0x605f
movl %eax, 0xb957(%rip)      # 0x15708
movl 0xb95d(%rip), %eax      # 0x15714
movl %eax, 0xb947(%rip)      # 0x15704
jmp 0x605f
// File: /workspace/github_c_makefile_star2_O3/garbeam[P]st/x.c
// Function: xximspot
void
xximspot(int x, int y)
{
	XPoint spot = { borderpx + x * win.cw, borderpx + (y + 1) * win.ch };
	XVaNestedList attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL);

	XSetICValues(xw.xic, XNPreeditAttributes, attr, NULL);
	XFree(attr);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
imull 0xccee(%rip), %edi      # 0x17eb4
addl $0x2, %edi
leaq 0xc(%rsp), %rdx
movw %di, (%rdx)
incl %esi
imull 0xccd6(%rip), %esi      # 0x17eb0
addl $0x2, %esi
movw %si, 0x2(%rdx)
leaq 0x39d4(%rip), %rsi      # 0xebbc
xorl %edi, %edi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x56a0
movq %rax, %rbx
movq 0xcc03(%rip), %rdi      # 0x17e00
leaq 0x39c5(%rip), %rsi      # 0xebc9
movq %rax, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5240
movq %rbx, %rdi
callq 0x5090
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/garbeam[P]st/x.c
// Function: ximopen
void
ximopen(Display *dpy)
{
	XIMCallback destroy = { .client_data = NULL, .callback = ximdestroy };

	if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
		XSetLocaleModifiers("@im=local");
		if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
			XSetLocaleModifiers("@im=");
			if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL)
				die("XOpenIM failed. Could not open input device.\n");
		}
	}
	if (XSetIMValues(xw.xim, XNDestroyCallback, &destroy, NULL) != NULL)
		die("XSetIMValues failed. Could not set input method value.\n");
	xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
				XNClientWindow, xw.win, XNFocusWindow, xw.win, NULL);
	if (xw.xic == NULL)
		die("XCreateIC failed. Could not obtain input method.\n");
}

// Assembly:
subq $0x18, %rsp
movups 0x6eb3(%rip), %xmm0     # 0x13230
movaps %xmm0, (%rsp)
movq 0xba28(%rip), %rdi      # 0x17db0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x5670
movq %rax, 0xba5e(%rip)      # 0x17df8
testq %rax, %rax
jne 0xc408
leaq 0x2b34(%rip), %rdi      # 0xeeda
callq 0x5730
movq 0xb9fe(%rip), %rdi      # 0x17db0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x5670
movq %rax, 0xba34(%rip)      # 0x17df8
testq %rax, %rax
jne 0xc408
leaq 0x2b14(%rip), %rdi      # 0xeee4
callq 0x5730
movq 0xb9d4(%rip), %rdi      # 0x17db0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x5670
movq %rax, 0xba0a(%rip)      # 0x17df8
testq %rax, %rax
jne 0xc408
leaq 0x2aef(%rip), %rdi      # 0xeee9
xorl %eax, %eax
callq 0x5e06
movq 0xb9f0(%rip), %rax      # 0x17df8
leaq 0x2b08(%rip), %rsi      # 0xef17
movq %rsp, %rdx
movq %rax, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5590
testq %rax, %rax
je 0xc431
leaq 0x2afd(%rip), %rdi      # 0xef27
xorl %eax, %eax
callq 0x5e06
movq 0xb9c0(%rip), %rdi      # 0x17df8
movq 0xb981(%rip), %r8       # 0x17dc0
leaq 0x2b19(%rip), %rsi      # 0xef5f
leaq 0x2b1d(%rip), %rcx      # 0xef6a
leaq 0x2b23(%rip), %r9       # 0xef77
movl $0x408, %edx            # imm = 0x408
xorl %eax, %eax
pushq $0x0
pushq %r8
callq 0x5030
addq $0x10, %rsp
movq %rax, 0xb991(%rip)      # 0x17e00
testq %rax, %rax
jne 0xc482
leaq 0x2b08(%rip), %rdi      # 0xef83
xorl %eax, %eax
callq 0x5e06
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/garbeam[P]st/x.c
// Function: brelease
void
brelease(XEvent *e)
{
	if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
		mousereport(e);
		return;
	}

	if (e->xbutton.button == Button2)
		selpaste(NULL);
	else if (e->xbutton.button == Button1)
		mousesel(e, 1);
}

// Assembly:
movzwl 0xb223(%rip), %eax      # 0x17eb8
testl $0xc018, %eax           # imm = 0xC018
je 0xcca6
testb $0x1, 0x50(%rdi)
je 0xd38d
movl 0x54(%rdi), %eax
cmpl $0x1, %eax
je 0xccda
cmpl $0x2, %eax
jne 0xcce4
movq 0xb0f6(%rip), %rdi      # 0x17db0
movq 0xb247(%rip), %rdx      # 0x17f08
movq 0xb0f8(%rip), %r8       # 0x17dc0
movl $0x1, %esi
movl $0x1, %ecx
xorl %r9d, %r9d
jmp 0x51a0
movl $0x1, %esi
jmp 0xd529
retq
// File: /workspace/github_c_makefile_star2_O3/garbeam[P]st/x.c
// Function: focus
void
focus(XEvent *ev)
{
	XFocusChangeEvent *e = &ev->xfocus;

	if (e->mode == NotifyGrab)
		return;

	if (ev->type == FocusIn) {
		XSetICFocus(xw.xic);
		win.mode |= MODE_FOCUSED;
		xseturgency(0);
		if (IS_SET(MODE_FOCUS))
			ttywrite("\033[I", 3, 0);
	} else {
		XUnsetICFocus(xw.xic);
		win.mode &= ~MODE_FOCUSED;
		if (IS_SET(MODE_FOCUS))
			ttywrite("\033[O", 3, 0);
	}
}

// Assembly:
pushq %rax
cmpl $0x1, 0x28(%rdi)
jne 0xcd0e
popq %rax
retq
cmpl $0x9, (%rdi)
movq 0xb0e8(%rip), %rdi      # 0x17e00
jne 0xcd3f
callq 0x5610
orb $0x2, 0xb192(%rip)      # 0x17eb8
xorl %edi, %edi
callq 0xb2ac
testb $0x20, 0xb185(%rip)     # 0x17eb9
je 0xcd0c
leaq 0x2637(%rip), %rdi      # 0xf374
jmp 0xcd62
callq 0x5390
movl 0xb16e(%rip), %eax      # 0x17eb8
movl %eax, %ecx
andl $-0x3, %ecx
movl %ecx, 0xb163(%rip)      # 0x17eb8
btl $0xd, %eax
jae 0xcd0c
leaq 0x2616(%rip), %rdi      # 0xf378
movl $0x3, %esi
xorl %edx, %edx
popq %rax
jmp 0x6c39
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/padding.c
// Function: usage
static int usage(int is_long_help)
{
	fprintf(stderr, "\n");
	fprintf(stderr, "Usage:   samtools depad <in.bam>\n\n");
	fprintf(stderr, "Options: -s       output is SAM (default is BAM)\n");
	fprintf(stderr, "         -S       input is SAM (default is BAM)\n");
	fprintf(stderr, "         -u       uncompressed BAM output (can't use with -s)\n");
	fprintf(stderr, "         -1       fast compression BAM output (can't use with -s)\n");
	fprintf(stderr, "         -T FILE  reference sequence file [null]\n");
	fprintf(stderr, "         -o FILE  output file name [stdout]\n");
	fprintf(stderr, "         -?       longer help\n");
	fprintf(stderr, "\n");
	if (is_long_help)
		fprintf(stderr, "Notes:\n\
\n\
  1. Requires embedded reference sequences (before the reads for that reference),\n\
     with the future aim to also support a FASTA padded reference sequence file.\n\
\n\
  2. The input padded alignment read's CIGAR strings must not use P or I operators.\n\
\n");
        return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
movq 0x4bbc4(%rip), %r12     # 0x4ffe8
movq (%r12), %rsi
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x3320
movq (%r12), %rcx
leaq 0x3e810(%rip), %rdi     # 0x42c4d
pushq $0x22
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x3700
movq (%r12), %rcx
leaq 0x3e819(%rip), %rdi     # 0x42c70
pushq $0x31
popq %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0x3700
movq (%r12), %rcx
leaq 0x3e831(%rip), %rdi     # 0x42ca2
pushq $0x30
popq %rsi
movq %r14, %rdx
callq 0x3700
movq (%r12), %rcx
leaq 0x3e84c(%rip), %rdi     # 0x42cd3
pushq $0x3e
popq %rsi
movq %r14, %rdx
callq 0x3700
movq (%r12), %rcx
leaq 0x3e875(%rip), %rdi     # 0x42d12
pushq $0x42
popq %rsi
movq %r14, %rdx
callq 0x3700
movq (%r12), %rcx
leaq 0x3e8a2(%rip), %rdi     # 0x42d55
movq %r15, %rsi
movq %r14, %rdx
callq 0x3700
movq (%r12), %rcx
leaq 0x3c370(%rip), %rdi     # 0x40839
pushq $0x2c
popq %rsi
movq %r14, %rdx
callq 0x3700
movq (%r12), %rcx
leaq 0x3c523(%rip), %rdi     # 0x40a02
pushq $0x1e
popq %rsi
movq %r14, %rdx
callq 0x3700
movq (%r12), %rsi
movl %ebp, %edi
callq 0x3320
testl %ebx, %ebx
jne 0x4502
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%r12), %rcx
leaq 0x3e87a(%rip), %rdi     # 0x42d87
pushq $0x1
popq %rdx
movl $0x101, %esi            # imm = 0x101
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3700
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_tview.c
// Function: base_tv_destroy
void base_tv_destroy(tview_t* tv)
	{
	bam_lplbuf_destroy(tv->lplbuf);
	bcf_call_destroy(tv->bca);
	bam_index_destroy(tv->idx);
	if (tv->fai) fai_destroy(tv->fai);
	free(tv->ref);
	bam_header_destroy(tv->header);
	bam_close(tv->fp);
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x2d2e1
movq 0x38(%rbx), %rdi
callq 0x10de1
movq 0x8(%rbx), %rdi
callq 0x298a9
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x6ef2
callq 0x2f578
movq 0x68(%rbx), %rdi
callq 0x3350
movq 0x18(%rbx), %rdi
callq 0x23577
movq 0x20(%rbx), %rdi
popq %rbx
jmp 0x21311
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_tview.c
// Function: tv_fetch_func
int tv_fetch_func(const bam1_t *b, void *data)
{
	tview_t *tv = (tview_t*)data;
    if ( tv->rg_hash )
    {
        const uint8_t *rg = bam_aux_get(b, "RG");
        if ( !rg ) return 0; 
        khiter_t k = kh_get(kh_rg, tv->rg_hash, (const char*)(rg + 1));
        if ( k == kh_end(tv->rg_hash) ) return 0;
    }
	if (tv->no_skip) {
		uint32_t *cigar = bam1_cigar(b); // this is cheating...
		int i;
		for (i = 0; i <b->core.n_cigar; ++i) {
			if ((cigar[i]&0xf) == BAM_CREF_SKIP)
				cigar[i] = cigar[i]>>4<<4 | BAM_CDEL;
		}
	}
	bam_lplbuf_push(b, tv->lplbuf);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
cmpq $0x0, 0x70(%rsi)
je 0x7038
leaq 0x3ae59(%rip), %rsi     # 0x41d91
movq 0x10(%rsp), %rdi
callq 0x22374
testq %rax, %rax
je 0x7093
movq 0x8(%rsp), %rcx
movq 0x70(%rcx), %rcx
movq %rcx, 0x18(%rsp)
movl (%rcx), %r15d
testl %r15d, %r15d
je 0x6f9c
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rsp)
movsbl (%rcx), %esi
xorl %edi, %edi
movl $0x0, %ecx
testl %esi, %esi
je 0x6fa6
movb 0x2(%rax), %dl
testb %dl, %dl
je 0x6fa4
addq $0x3, %rax
movl %esi, %ecx
movl %ecx, %esi
shll $0x5, %esi
subl %ecx, %esi
movsbl %dl, %ecx
addl %esi, %ecx
movb (%rax), %dl
incq %rax
testb %dl, %dl
jne 0x6f85
jmp 0x6fa6
xorl %r14d, %r14d
jmp 0x7033
movl %esi, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %r15d
movl %edx, %ebx
leal -0x1(%r15), %esi
movl %ecx, %eax
xorl %edx, %edx
divl %esi
incl %edx
movq 0x18(%rsp), %rax
movq 0x10(%rax), %r12
movl %ebx, %r14d
movl %edx, 0x4(%rsp)
movl %r14d, %eax
shrl $0x4, %eax
movl (%r12,%rax,4), %ebp
leal (%r14,%r14), %r13d
andl $0x1e, %r13d
movl %ebp, %eax
movl %r13d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x7026
testb $0x1, %al
jne 0x7010
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x20(%rsp), %rsi
callq 0x35a0
movl 0x4(%rsp), %edx
xorl %edi, %edi
testl %eax, %eax
je 0x7026
addl %edx, %r14d
cmpl %r15d, %r14d
movl %r15d, %eax
cmovbl %edi, %eax
subl %eax, %r14d
cmpl %ebx, %r14d
jne 0x6fcb
jmp 0x7093
movl %r13d, %ecx
shrl %cl, %ebp
testb $0x3, %bpl
cmovnel %r15d, %r14d
cmpl %r15d, %r14d
je 0x7093
movq 0x8(%rsp), %r9
cmpl $0x0, 0x60(%r9)
movq 0x10(%rsp), %rdi
je 0x708a
movq 0x8(%rdi), %rax
movq %rax, %rcx
shrq $0x30, %rcx
je 0x708a
movl %eax, %ecx
shrl $0x18, %ecx
addq 0x30(%rdi), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
movl %esi, %r8d
andl $0xf, %r8d
cmpl $0x3, %r8d
jne 0x707b
andl $-0xe, %esi
movl %esi, (%rcx,%rdx,4)
movq 0x8(%rdi), %rax
incq %rdx
movq %rax, %rsi
shrq $0x30, %rsi
cmpq %rsi, %rdx
jb 0x7061
movq 0x10(%r9), %rsi
callq 0x2d478
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_tview.c
// Function: error
static void error(const char *format, ...)
{
    if ( !format )
    {
        fprintf(stderr, "\n");
        fprintf(stderr, "Usage: bamtk tview [options] <aln.bam> [ref.fasta]\n");
        fprintf(stderr, "Options:\n");
        fprintf(stderr, "   -d display      output as (H)tml or (C)urses or (T)ext \n");
        fprintf(stderr, "   -p chr:pos      go directly to this position\n");
        fprintf(stderr, "   -s STR          display only reads from this sample or group\n");
        fprintf(stderr, "\n\n");
    }
    else
    {
        va_list ap;
        va_start(ap, format);
        vfprintf(stderr, format, ap);
        va_end(ap);
    }
    exit(-1);
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x74db
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)
testq %rdi, %rdi
jne 0x7590
movq 0x48afd(%rip), %rbx     # 0x4ffe8
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x3320
movq (%rbx), %rcx
leaq 0x37d5a(%rip), %rdi     # 0x3f25c
movl $0x33, %esi
movl $0x1, %edx
callq 0x3700
movq (%rbx), %rcx
leaq 0x37d75(%rip), %rdi     # 0x3f290
movl $0x9, %esi
movl $0x1, %edx
callq 0x3700
movq (%rbx), %rcx
leaq 0x37d66(%rip), %rdi     # 0x3f29a
movl $0x3b, %esi
movl $0x1, %edx
callq 0x3700
movq (%rbx), %rcx
leaq 0x37d89(%rip), %rdi     # 0x3f2d6
movl $0x30, %esi
movl $0x1, %edx
callq 0x3700
movq (%rbx), %rcx
leaq 0x37da1(%rip), %rdi     # 0x3f307
movl $0x40, %esi
movl $0x1, %edx
callq 0x3700
movq (%rbx), %rcx
leaq 0x39b7a(%rip), %rdi     # 0x410f9
movl $0x2, %esi
movl $0x1, %edx
callq 0x3700
jmp 0x75ca
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x48a29(%rip), %rax     # 0x4ffe8
movq (%rax), %rdi
movq %r10, %rsi
callq 0x32d0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x31a0
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/sam_view.c
// Function: main_import
int main_import(int argc, char *argv[])
{
	int argc2, ret;
	char **argv2;
	if (argc != 4) {
		fprintf(stderr, "Usage: bamtk import <in.ref_list> <in.sam> <out.bam>\n");
		return 1;
	}
	argc2 = 6;
	argv2 = calloc(6, sizeof(char*));
	argv2[0] = "import", argv2[1] = "-o", argv2[2] = argv[3], argv2[3] = "-bt", argv2[4] = argv[1], argv2[5] = argv[2];
	ret = main_samview(argc2, argv2);
	free(argv2);
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x4, %edi
jne 0xae49
movq %rsi, %rbx
movl $0x6, %edi
movl $0x8, %esi
callq 0x3610
movq %rax, %r14
leaq 0x356b0(%rip), %rax     # 0x404ae
movq %rax, (%r14)
leaq 0x356ad(%rip), %rax     # 0x404b5
movq %rax, 0x8(%r14)
movq 0x18(%rbx), %rax
movq %rax, 0x10(%r14)
leaq 0x3569d(%rip), %rax     # 0x404b8
movq %rax, 0x18(%r14)
movups 0x8(%rbx), %xmm0
movups %xmm0, 0x20(%r14)
movl $0x6, %edi
movq %r14, %rsi
callq 0x9ae0
movl %eax, %ebx
movq %r14, %rdi
callq 0x3350
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x3d8e
movl $0x1, %eax
jmp 0xae41
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_rmdup.c
// Function: clear_best
static void clear_best(khash_t(lib) *aux, int max)
{
	khint_t k;
	for (k = kh_begin(aux); k != kh_end(aux); ++k) {
		if (kh_exist(aux, k)) {
			lib_aux_t *q = &kh_val(aux, k);
			if (kh_size(q->best_hash) >= max)
				kh_clear(pos, q->best_hash);
		}
	}
}

// Assembly:
movl (%rdi), %eax
testl %eax, %eax
je 0xc124
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x10(%r14), %rcx
movl %r15d, %edx
shrl $0x4, %edx
movl (%rcx,%rdx,4), %edx
movl %ebp, %ecx
andb $0x1e, %cl
shrl %cl, %edx
testb $0x3, %dl
jne 0xc111
movq 0x20(%r14), %rcx
movl %r15d, %edx
leaq (%rdx,%rdx,2), %rdx
movq 0x10(%rcx,%rdx,8), %r12
cmpl %ebx, 0x4(%r12)
jb 0xc111
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0xc111
movl (%r12), %eax
shrl $0x4, %eax
leaq 0x4(,%rax,4), %rdx
movl $0xaa, %esi
callq 0x3080
movq $0x0, 0x4(%r12)
movl (%r14), %eax
incl %r15d
addl $0x2, %ebp
cmpl %eax, %r15d
jne 0xc0b2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_rmdup.c
// Function: clear_del_set
static void clear_del_set(khash_t(name) *del_set)
{
	khint_t k;
	for (k = kh_begin(del_set); k < kh_end(del_set); ++k)
		if (kh_exist(del_set, k))
			free((char*)kh_key(del_set, k));
	kh_clear(name, del_set);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
testl %eax, %eax
je 0xc17d
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rcx
movq %r15, %rdx
shrq $0x4, %rdx
movl (%rcx,%rdx,4), %edx
movl %r14d, %ecx
andb $0x1e, %cl
shrl %cl, %edx
testb $0x3, %dl
jne 0xc163
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x3350
movl (%rbx), %eax
incq %r15
movl %eax, %ecx
addl $0x2, %r14d
cmpq %rcx, %r15
jb 0xc139
shrl $0x4, %eax
leal 0x4(,%rax,4), %edx
jmp 0xc182
movl $0x4, %edx
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xc19d
movl $0xaa, %esi
callq 0x3080
movq $0x0, 0x4(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_rmdup.c
// Function: bam_rmdup
int bam_rmdup(int argc, char *argv[])
{
	int c, is_se = 0, force_se = 0;
	samfile_t *in, *out;
	while ((c = getopt(argc, argv, "sS")) >= 0) {
		switch (c) {
		case 's': is_se = 1; break;
		case 'S': force_se = is_se = 1; break;
		}
	}
	if (optind + 2 > argc) {
		fprintf(stderr, "\n");
		fprintf(stderr, "Usage:  samtools rmdup [-sS] <input.srt.bam> <output.bam>\n\n");
		fprintf(stderr, "Option: -s    rmdup for SE reads\n");
		fprintf(stderr, "        -S    treat PE reads as SE in rmdup (force -s)\n\n");
		return 1;
	}
	in = samopen(argv[optind], "rb", 0);
	out = samopen(argv[optind+1], "wb", in->header);
	if (in == 0 || out == 0) {
		fprintf(stderr, "[bam_rmdup] fail to read/write input files\n");
		return 1;
	}
	if (is_se) bam_rmdupse_core(in, out, force_se);
	else bam_rmdup_core(in, out);
	samclose(in); samclose(out);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
leaq 0x3470c(%rip), %rdx     # 0x41062
callq 0x3210
testl %eax, %eax
js 0xc99c
xorl %r12d, %r12d
leaq 0x346f9(%rip), %r15     # 0x41062
xorl %ebx, %ebx
cmpl $0x53, %eax
je 0xc977
cmpl $0x73, %eax
je 0xc97c
jmp 0xc982
movl $0x1, %ebx
movl $0x1, %r12d
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3210
testl %eax, %eax
jns 0xc96b
testl %r12d, %r12d
sete %r12b
jmp 0xc9a1
movb $0x1, %r12b
xorl %ebx, %ebx
movq 0x43610(%rip), %r13     # 0x4ffb8
movslq (%r13), %rax
leal 0x2(%rax), %ecx
cmpl %ebp, %ecx
jg 0xca23
movq (%r14,%rax,8), %rdi
leaq 0x3473e(%rip), %rsi     # 0x410fc
xorl %edx, %edx
callq 0x27ef0
movq %rax, %r15
movslq (%r13), %rax
movq 0x8(%r14,%rax,8), %rdi
movq 0x10(%r15), %rdx
leaq 0x34723(%rip), %rsi     # 0x410ff
callq 0x27ef0
testq %rax, %rax
je 0xca2a
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
testb %r12b, %r12b
je 0xc9fb
callq 0xb2cc
jmp 0xca02
movl %ebx, %edx
callq 0xca38
movq %r15, %rdi
callq 0x2836b
movq %r14, %rdi
callq 0x2836b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3e29
jmp 0xca2f
callq 0x3e0d
movl $0x1, %eax
jmp 0xca14
nop
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_rmdupse.c
// Function: dump_alignment
static void dump_alignment(samfile_t *out, queue_t *queue, int32_t pos, khash_t(lib) *h)
{
	if (queue->size > QUEUE_CLEAR_SIZE || pos == MAX_POS) {
		khint_t k;
		while (1) {
			elem_t *q;
			if (queue->head == queue->tail) break;
			q = &kl_val(queue->head);
			if (q->discarded) {
				q->b->data_len = 0;
				kl_shift(q, queue, 0);
				continue;
			}
			if ((q->b->core.flag&BAM_FREVERSE) && q->endpos > pos) break;
			samwrite(out, q->b);
			q->b->data_len = 0;
			kl_shift(q, queue, 0);
		}
		for (k = kh_begin(h); k != kh_end(h); ++k) {
			if (kh_exist(h, k)) {
				clear_besthash(kh_val(h, k).left, pos);
				clear_besthash(kh_val(h, k).rght, pos);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
je 0xd57a
cmpq $0x100001, 0x18(%r14)   # imm = 0x100001
jb 0xd5e2
jmp 0xd57a
cmpl $0x0, 0x4(%r13)
movq 0x8(%r13), %rsi
js 0xd50e
testb $0x10, 0xc(%rsi)
je 0xd4f6
cmpl %ebp, (%r13)
jg 0xd587
movq %r15, %rdi
callq 0x283e6
movq 0x8(%r13), %rax
movl $0x0, 0x24(%rax)
movq (%r14), %r13
jmp 0xd515
movl $0x0, 0x24(%rsi)
movq 0x10(%r13), %rax
testq %rax, %rax
je 0xd57a
decq 0x18(%r14)
movq %rax, (%r14)
movq 0x10(%r14), %r12
decq (%r12)
movq 0x8(%r12), %rcx
cmpq 0x10(%r12), %rcx
jne 0xd568
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x10, %eax
cmoveq %rax, %rsi
movq %rsi, 0x10(%r12)
movq 0x18(%r12), %rdi
shlq $0x3, %rsi
callq 0x3720
movq %rax, 0x18(%r12)
movq 0x8(%r12), %rcx
jmp 0xd56d
movq 0x18(%r12), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%r12)
movq %r13, (%rax,%rcx,8)
movq (%r14), %r13
cmpq 0x8(%r14), %r13
jne 0xd4db
movl (%rbx), %eax
testl %eax, %eax
je 0xd5e2
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rcx
movl %r15d, %edx
shrl $0x4, %edx
movl (%rcx,%rdx,4), %edx
movl %r14d, %ecx
andb $0x1e, %cl
shrl %cl, %edx
testb $0x3, %dl
jne 0xd5d6
movq 0x20(%rbx), %rax
movl %r15d, %r12d
shlq $0x5, %r12
movq 0x10(%rax,%r12), %rdi
movl %ebp, %esi
callq 0xdbb0
movq 0x20(%rbx), %rax
movq 0x18(%rax,%r12), %rdi
movl %ebp, %esi
callq 0xdbb0
movl (%rbx), %eax
incl %r15d
addl $0x2, %r14d
cmpl %eax, %r15d
jne 0xd593
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_rmdupse.c
// Function: clear_besthash
static void clear_besthash(besthash_t *h, int32_t pos)
{
	khint_t k;
	for (k = kh_begin(h); k != kh_end(h); ++k)
		if (kh_exist(h, k) && kh_val(h, k)->endpos <= pos)
			kh_del(best, h, k);
}

// Assembly:
movl (%rdi), %r8d
testl %r8d, %r8d
je 0xdc09
pushq %r14
pushq %rbx
movq 0x10(%rdi), %rax
xorl %edx, %edx
xorl %r9d, %r9d
movl %r9d, %r10d
shrl $0x4, %r10d
movl (%rax,%r10,4), %r11d
movl %edx, %ecx
andl $0x1e, %ecx
movl %r11d, %ebx
shrl %cl, %ebx
testb $0x3, %bl
jne 0xdbfb
movq 0x20(%rdi), %rbx
movl %r9d, %r14d
movq (%rbx,%r14,8), %rbx
cmpl %esi, (%rbx)
jg 0xdbfb
btsl %ecx, %r11d
movl %r11d, (%rax,%r10,4)
decl 0x4(%rdi)
movl (%rdi), %r8d
incl %r9d
addl $0x2, %edx
cmpl %r8d, %r9d
jne 0xdbc4
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_mate.c
// Function: usage
void usage()
{
    fprintf(stderr,"Usage: samtools fixmate <in.nameSrt.bam> <out.nameSrt.bam>\n");
    fprintf(stderr,"Options:\n");
    fprintf(stderr,"       -r    remove unmapped reads and secondary alignments\n");
    exit(1);
}

// Assembly:
pushq %rbx
movq 0x41a39(%rip), %rbx     # 0x4ffe8
movq (%rbx), %rcx
leaq 0x32cc5(%rip), %rdi     # 0x4127e
movl $0x3b, %esi
movl $0x1, %edx
callq 0x3700
movq (%rbx), %rcx
leaq 0x30cbe(%rip), %rdi     # 0x3f290
movl $0x9, %esi
movl $0x1, %edx
callq 0x3700
movq (%rbx), %rcx
leaq 0x32ccf(%rip), %rdi     # 0x412ba
movl $0x3c, %esi
movl $0x1, %edx
callq 0x3700
movl $0x1, %edi
callq 0x31a0
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_mate.c
// Function: bam_mating
int bam_mating(int argc, char *argv[])
{
	bamFile in, out;
    int c, remove_reads=0;
    while ((c = getopt(argc, argv, "r")) >= 0) {
        switch (c) {
            case 'r': remove_reads=1; break;
        }
    }
    if (optind+1 >= argc) usage();
	in = (strcmp(argv[optind], "-") == 0)? bam_dopen(fileno(stdin), "r") : bam_open(argv[optind], "r");
    out = (strcmp(argv[optind+1], "-") == 0)? bam_dopen(fileno(stdout), "w") : bam_open(argv[optind+1], "w");
	bam_mating_core(in, out, remove_reads);
	bam_close(in); bam_close(out);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
leaq 0x37737(%rip), %rdx     # 0x45d4f
callq 0x3210
xorl %ebx, %ebx
testl %eax, %eax
js 0xe648
movl $0x1, %r12d
leaq 0x3771f(%rip), %r15     # 0x45d4f
cmpl $0x72, %eax
cmovel %r12d, %ebx
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3210
testl %eax, %eax
jns 0xe630
movq 0x41969(%rip), %r12     # 0x4ffb8
movslq (%r12), %rax
leal 0x1(%rax), %ecx
cmpl %ebp, %ecx
jge 0xe705
movq (%r14,%rax,8), %rdi
cmpb $0x2d, (%rdi)
jne 0xe66d
cmpb $0x0, 0x1(%rdi)
je 0xe6c7
leaq 0x376db(%rip), %rsi     # 0x45d4f
callq 0x20308
movq %rax, %r15
movslq (%r12), %rax
movq 0x8(%r14,%rax,8), %rdi
cmpb $0x2d, (%rdi)
jne 0xe690
cmpb $0x0, 0x1(%rdi)
je 0xe6e6
leaq 0x30bc3(%rip), %rsi     # 0x3f25a
callq 0x20308
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
movl %ebx, %edx
callq 0xe22d
movq %r15, %rdi
callq 0x21311
movq %r14, %rdi
callq 0x21311
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x41902(%rip), %rax     # 0x4ffd0
movq (%rax), %rdi
callq 0x3030
leaq 0x37672(%rip), %rsi     # 0x45d4f
movl %eax, %edi
callq 0x20487
jmp 0xe679
movq 0x4190b(%rip), %rax     # 0x4fff8
movq (%rax), %rdi
callq 0x3030
leaq 0x30b5e(%rip), %rsi     # 0x3f25a
movl %eax, %edi
callq 0x20487
jmp 0xe69c
callq 0xe5a7
nop
// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_stat.c
// Function: bam_flagstat_core
bam_flagstat_t *bam_flagstat_core(bamFile fp)
{
	bam_flagstat_t *s;
	bam1_t *b;
	bam1_core_t *c;
	int ret;
	s = (bam_flagstat_t*)calloc(1, sizeof(bam_flagstat_t));
	b = bam_init1();
	c = &b->core;
	while ((ret = bam_read1(fp, b)) >= 0)
		flagstat_loop(s, c);
	bam_destroy1(b);
	if (ret != -1)
		fprintf(stderr, "[bam_flagstat_core] Truncated file? Continue anyway.\n");
	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
movl $0x1, %edi
movl $0xb0, %esi
callq 0x3610
movq %rax, %rbx
movl $0x1, %edi
movl $0x38, %esi
callq 0x3610
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x2393b
testl %eax, %eax
js 0xe80f
movq 0x8(%r14), %rcx
movq %rcx, %rax
shrq $0x29, %rax
andl $0x1, %eax
movl %eax, %edx
incq (%rbx,%rdx,8)
btq $0x20, %rcx
jae 0xe7dd
incq 0x20(%rbx,%rax,8)
btq $0x21, %rcx
jae 0xe779
incq 0x40(%rbx,%rax,8)
btq $0x26, %rcx
jae 0xe785
incq 0x60(%rbx,%rax,8)
btq $0x27, %rcx
jae 0xe791
incq 0x70(%rbx,%rax,8)
movq %rcx, %rdx
shrq $0x20, %rdx
andl $0xc, %edx
cmpl $0x8, %edx
je 0xe7d1
testl %edx, %edx
jne 0xe7dd
incq 0x30(%rbx,%rax,8)
movl 0x14(%r14), %edx
cmpl (%r14), %edx
je 0xe7dd
incq 0x90(%rbx,%rax,8)
movl %ecx, %esi
andl $0xff0000, %esi         # imm = 0xFF0000
movl $0xa0, %edx
cmpl $0x40001, %esi          # imm = 0x40001
jae 0xe7d6
jmp 0xe7dd
movl $0x50, %edx
addq %rbx, %rdx
incq (%rdx,%rax,8)
btq $0x22, %rcx
jb 0xe7e9
incq 0x10(%rbx,%rax,8)
btq $0x2a, %rcx
jae 0xe7f8
incq 0x80(%rbx,%rax,8)
movq %r15, %rdi
movq %r14, %rsi
callq 0x2393b
testl %eax, %eax
jns 0xe74d
movl %eax, %ebp
jmp 0xe816
movl %eax, %ebp
testq %r14, %r14
je 0xe827
movq 0x30(%r14), %rdi
callq 0x3350
movq %r14, %rdi
callq 0x3350
cmpl $-0x1, %ebp
jne 0xe83a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x3f7e
jmp 0xe82c