LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/annotationsketch/custom_track_script_wrapper.c
// Function: gt_custom_track_script_wrapper_class
const GtCustomTrackClass* gt_custom_track_script_wrapper_class(void)
{
  static const GtCustomTrackClass *ctc = NULL;
  gt_class_alloc_lock_enter();
  if (!ctc)
  {
    ctc = gt_custom_track_class_new(sizeof (GtCustomTrackScriptWrapper),
                                    gt_custom_track_script_wrapper_sketch,
                                    gt_custom_track_script_wrapper_get_height,
                                    gt_custom_track_script_wrapper_get_title,
                                    gt_custom_track_script_wrapper_delete);
  }
  gt_class_alloc_lock_leave();
  return ctc;
}

// Assembly:
pushq %rax
callq 0x1456d7
cmpq $0x0, 0x1d4857(%rip)    # 0x497cf8
jne 0x2c34d0
leaq -0x72(%rip), %rsi       # 0x2c3438
leaq 0x2d(%rip), %rdx        # 0x2c34de
leaq 0x40(%rip), %rcx        # 0x2c34f8
leaq 0x6c(%rip), %r8         # 0x2c352b
movl $0x38, %edi
callq 0x2c26c0
movq %rax, 0x1d4828(%rip)    # 0x497cf8
callq 0x1456ed
movq 0x1d481c(%rip), %rax    # 0x497cf8
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/annotationsketch/custom_track_script_wrapper.c
// Function: gt_custom_track_script_wrapper_get_title
const char* gt_custom_track_script_wrapper_get_title(GtCustomTrack *ct)
{
  GtCustomTrackScriptWrapper *cte;
  cte = gt_custom_track_script_wrapper_cast(ct);
  gt_str_reset(cte->title_buffer);
  cte->get_title_func(NULL, cte->title_buffer);
  return gt_str_get(cte->title_buffer);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2c3493
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2c284a
movq %rax, %rbx
movq 0x30(%rax), %rdi
callq 0x316e0
movq 0x30(%rbx), %rsi
xorl %edi, %edi
callq *0x20(%rbx)
movq 0x30(%rbx), %rdi
popq %rbx
jmp 0x31b20
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/annotationsketch/custom_track_script_wrapper.c
// Function: gt_custom_track_script_wrapper_delete
void gt_custom_track_script_wrapper_delete(GtCustomTrack *ct)
{
  GtCustomTrackScriptWrapper *cte;
  if (!ct) return;
  cte = gt_custom_track_script_wrapper_cast(ct);
  cte->free_func(NULL);
  gt_str_delete(cte->title_buffer);
}

// Assembly:
testq %rdi, %rdi
je 0x2c3556
pushq %rbx
movq %rdi, %rbx
callq 0x2c3493
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2c284a
movq %rax, %rbx
xorl %edi, %edi
callq *0x28(%rax)
movq 0x30(%rbx), %rdi
popq %rbx
jmp 0x31fe0
retq
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/annotationsketch/custom_track_script_wrapper.c
// Function: gt_custom_track_script_wrapper_new
GtCustomTrack* gt_custom_track_script_wrapper_new(GtCtScriptRenderFunc
                                                             render_func,
                                                  GtCtScriptGetHeightFunc
                                                             get_height_func,
                                                  GtCtScriptGetTitleFunc
                                                             get_title_func,
                                                  GtCtScriptFreeFunc
                                                             free_func)
{
  GtCustomTrackScriptWrapper *cte;
  GtCustomTrack *ct;
  ct = gt_custom_track_create(gt_custom_track_script_wrapper_class());
  cte = gt_custom_track_script_wrapper_cast(ct);
  cte->render_func = render_func;
  cte->get_height_func = get_height_func;
  cte->get_title_func = get_title_func;
  cte->free_func = free_func;
  cte->title_buffer = gt_str_new();
  return ct;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0x2c3493
movq %rax, %rdi
callq 0x2c26ff
movq %rax, %r13
callq 0x2c3493
movq %rax, %rdi
movq %r13, %rsi
callq 0x2c284a
movq %rax, %rbp
movq %r12, 0x10(%rax)
movq %r15, 0x18(%rax)
movq %r14, 0x20(%rax)
movq %rbx, 0x28(%rax)
callq 0x30600
movq %rax, 0x30(%rbp)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/samtools-0.1.18/bam_sort.c
// Function: bam_sort
int bam_sort(int argc, char *argv[])
{
	size_t max_mem = 500000000;
	int c, is_by_qname = 0, is_stdout = 0;
	while ((c = getopt(argc, argv, "nom:")) >= 0) {
		switch (c) {
		case 'o': is_stdout = 1; break;
		case 'n': is_by_qname = 1; break;
		case 'm': max_mem = atol(optarg); break;
		}
	}
	if (optind + 2 > argc) {
		fprintf(stderr, "Usage: samtools sort [-on] [-m <maxMem>] <in.bam> <out.prefix>\n");
		return 1;
	}
	bam_sort_core_ext(is_by_qname, argv[optind], argv[optind+1], max_mem, is_stdout);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xbe28b(%rip), %rdx     # 0x3c2967
callq 0x2e000
testl %eax, %eax
js 0x30473c
movl $0x1dcd6500, %r15d      # imm = 0x1DCD6500
xorl %r14d, %r14d
leaq 0xbe272(%rip), %r13     # 0x3c2967
xorl %r12d, %r12d
cmpl $0x6d, %eax
je 0x304717
cmpl $0x6e, %eax
je 0x30470f
cmpl $0x6f, %eax
jne 0x304729
movl $0x1, %r14d
jmp 0x304729
movl $0x1, %r12d
jmp 0x304729
movq 0x18b852(%rip), %rax    # 0x48ff70
movq (%rax), %rdi
callq 0x2f650
movq %rax, %r15
movl %ebp, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2e000
testl %eax, %eax
jns 0x3046f8
jmp 0x304748
xorl %r12d, %r12d
movl $0x1dcd6500, %r15d      # imm = 0x1DCD6500
xorl %r14d, %r14d
movq 0x18b7d9(%rip), %rax    # 0x48ff28
movslq (%rax), %rax
leal 0x2(%rax), %ecx
cmpl %ebp, %ecx
jg 0x304781
movq (%rbx,%rax,8), %rsi
movq 0x8(%rbx,%rax,8), %rdx
movl %r12d, %edi
movq %r15, %rcx
movl %r14d, %r8d
callq 0x304284
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xab2f6
movl $0x1, %eax
jmp 0x304772
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/samtools-0.1.18/bam_sort.c
// Function: strnum_cmp
static inline int strnum_cmp(const char *a, const char *b)
{
	char *pa, *pb;
	pa = (char*)a; pb = (char*)b;
	while (*pa && *pb) {
		if (isdigit(*pa) && isdigit(*pb)) {
			long ai, bi;
			ai = strtol(pa, &pa, 10);
			bi = strtol(pb, &pb, 10);
			if (ai != bi) return ai<bi? -1 : ai>bi? 1 : 0;
		} else {
			if (*pa != *pb) break;
			++pa; ++pb;
		}
	}
	if (*pa == *pb)
		return (pa-a) < (pb-b)? -1 : (pa-a) > (pb-b)? 1 : 0;
	return *pa<*pb? -1 : *pa>*pb? 1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq %rdi, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rsi, (%rsp)
movb (%rdi), %r12b
movq %rdi, %r13
testb %r12b, %r12b
je 0x304844
movq (%rsp), %r15
movsbq (%r15), %rbx
testq %rbx, %rbx
je 0x304844
callq 0x2f1b0
movq (%rax), %rax
movsbq %r12b, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x3047e2
testb $0x8, 0x1(%rax,%rbx,2)
jne 0x3047f8
cmpb %bl, %r12b
jne 0x304844
incq %r13
movq %r13, 0x8(%rsp)
incq %r15
movq %r15, (%rsp)
jmp 0x304832
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x2fbd0
movq %rax, %r13
movq %r15, %rdi
movq %rsp, %rsi
movl $0xa, %edx
callq 0x2fbd0
xorl %ecx, %ecx
cmpq %rax, %r13
setg %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovll %eax, %ecx
cmovnel %ecx, %ebp
jne 0x304875
movq 0x8(%rsp), %r13
movb (%r13), %r12b
testb %r12b, %r12b
jne 0x3047bb
movq (%rsp), %rax
cmpb (%rax), %r12b
jne 0x304867
subq %r14, %r13
subq 0x10(%rsp), %rax
xorl %ecx, %ecx
cmpq %rax, %r13
setg %cl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmovgel %ecx, %ebp
jmp 0x304875
setg %al
movzbl %al, %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmovgel %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/samtools-0.1.18/bam_reheader.c
// Function: bam_reheader
int bam_reheader(BGZF *in, const bam_header_t *h, int fd)
{
	BGZF *fp;
	bam_header_t *old;
	int len;
	uint8_t *buf;
	if (in->open_mode != 'r') return -1;
	buf = malloc(BUF_SIZE);
	old = bam_header_read(in);
	fp = bgzf_fdopen(fd, "w");
	bam_header_write(fp, h);
	if (in->block_offset < in->block_length) {
		bgzf_write(fp, in->uncompressed_block + in->block_offset, in->block_length - in->block_offset);
		bgzf_flush(fp);
	}
#ifdef _USE_KNETFILE
	while ((len = knet_read(in->x.fpr, buf, BUF_SIZE)) > 0)
		fwrite(buf, 1, len, fp->x.fpw);
#else
	while (!feof(in->file) && (len = fread(buf, 1, BUF_SIZE, in->file)) > 0)
		fwrite(buf, 1, len, fp->file);
#endif
	free(buf);
	fp->block_offset = in->block_offset = 0;
	bgzf_close(fp);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpb $0x72, 0x4(%rdi)
jne 0x305eba
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %rbx
movl $0x10000, %edi          # imm = 0x10000
callq 0x32008
movq %rax, %r14
movq %rbx, %rdi
callq 0x2f18d8
leaq 0x79fb9(%rip), %rsi     # 0x37fddd
movl %ebp, %edi
callq 0x2ef17d
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0x2f1aa1
movslq 0x3c(%rbx), %rax
movl 0x38(%rbx), %edx
cmpl %eax, %edx
jle 0x305e92
movq %rax, %rsi
addq 0x20(%rbx), %rsi
subl %eax, %edx
movq %r15, %rdi
callq 0x2efa96
movq %r15, %rdi
callq 0x2ef7b8
jmp 0x305e92
movq 0x10(%rbx), %rcx
movl $0x1, %esi
movl $0x10000, %edx          # imm = 0x10000
movq %r14, %rdi
callq 0x30320
testl %eax, %eax
jle 0x305e9f
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq 0x10(%r15), %rcx
movl $0x1, %esi
movq %r14, %rdi
movq %rax, %rdx
callq 0x31720
movq 0x10(%rbx), %rdi
callq 0x30f90
testl %eax, %eax
je 0x305e5f
movq %r14, %rdi
callq 0x32018
xorl %r14d, %r14d
movl %r14d, 0x3c(%rbx)
movl %r14d, 0x3c(%r15)
movq %r15, %rdi
callq 0x2eef2d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/tre/lib/tre-filter.c
// Function: tre_filter_find
int
tre_filter_find(const unsigned char *str, size_t len, tre_filter_t *filter)
{
  unsigned short counts[256];
  unsigned int i;
  unsigned int window_len = filter->window_len;
  tre_filter_profile_t *profile = filter->profile;
  const unsigned char *str_orig = str;

  DPRINT(("tre_filter_find: %.*s\n", len, str));

  for (i = 0; i < elementsof(counts); i++)
    counts[i] = 0;

  i = 0;
  while (*str && i < window_len && i < len)
    {
      counts[*str]++;
      i++;
      str++;
      len--;
    }

  while (len > 0)
    {
      tre_filter_profile_t *p;
      counts[*str]++;
      counts[*(str - window_len)]--;

      p = profile;
      while (p->ch)
	{
	  if (counts[p->ch] < p->count)
	    break;
	  p++;
	}
      if (!p->ch)
	{
	  DPRINT(("Found possible match at %d\n",
		  str - str_orig));
	  return str - str_orig;
	}
      else
	{
	  DPRINT(("No match so far...\n"));
	}
      len--;
      str++;
    }
  DPRINT(("This string cannot match.\n"));
  return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdx), %ebp
movl %ebp, %r15d
movq 0x8(%rdx), %r12
movq %rsp, %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x2d4b0
movb (%r14), %al
testb %al, %al
sete %cl
testl %ebp, %ebp
sete %dl
orb %cl, %dl
testq %rbx, %rbx
sete %cl
orb %dl, %cl
jne 0x31f07b
movl $0x1, %ecx
movzbl %al, %eax
incw (%rsp,%rax,2)
decq %rbx
movb (%r14,%rcx), %al
leaq 0x1(%rcx), %rdx
testb %al, %al
je 0x31f072
cmpq %r15, %rcx
jae 0x31f072
cmpq %rcx, %rbx
movq %rdx, %rcx
ja 0x31f04f
leaq (%r14,%rdx), %rcx
decq %rcx
jmp 0x31f07e
movq %r14, %rcx
negq %r15
leaq 0x3(%r12), %rdx
testq %rbx, %rbx
je 0x31f0ef
movzbl (%rcx), %esi
incw (%rsp,%rsi,2)
movzbl (%rcx,%r15), %esi
decw (%rsp,%rsi,2)
movzbl (%r12), %edi
testq %rdi, %rdi
setne %sil
je 0x31f0d6
movzbl 0x1(%r12), %r8d
cmpw %r8w, (%rsp,%rdi,2)
jb 0x31f0d6
movq %rdx, %rdi
movzbl -0x1(%rdi), %r8d
testq %r8, %r8
setne %sil
je 0x31f0d6
movzbl (%rdi), %r9d
addq $0x2, %rdi
cmpw %r9w, (%rsp,%r8,2)
jae 0x31f0b9
movl %ecx, %edi
subl %r14d, %edi
movzbl %sil, %esi
subq %rsi, %rbx
addq %rsi, %rcx
testb %sil, %sil
cmovel %edi, %eax
jne 0x31f086
jmp 0x31f0f4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/tre/lib/xmalloc.c
// Function: xmalloc_init
static void
xmalloc_init(void)
{
  if (xmalloc_table == NULL)
    {
      xmalloc_table = hash_table_new();
      xmalloc_peak = 0;
      xmalloc_peak_blocks = 0;
      xmalloc_current = 0;
      xmalloc_current_blocks = 0;
      xmalloc_fail_after = -1;
    }
  assert(xmalloc_table != NULL);
  assert(xmalloc_table->table != NULL);
}

// Assembly:
pushq %rbx
cmpq $0x0, 0x176dab(%rip)    # 0x49a878
jne 0x323b33
movl $0x8, %edi
callq 0x32008
movq %rax, %rbx
testq %rax, %rax
je 0x323b02
movl $0x100, %edi            # imm = 0x100
movl $0x8, %esi
callq 0x30ed0
movq %rax, (%rbx)
testq %rax, %rax
jne 0x323b02
movq %rbx, %rdi
callq 0x32018
xorl %ebx, %ebx
movq %rbx, 0x176d6f(%rip)    # 0x49a878
xorl %eax, %eax
movl %eax, 0x176d6f(%rip)    # 0x49a880
movl %eax, 0x176d6d(%rip)    # 0x49a884
leaq 0x176d6a(%rip), %rcx    # 0x49a888
movl %eax, (%rcx)
leaq 0x176d65(%rip), %rcx    # 0x49a88c
movl %eax, (%rcx)
movl $0xffffffff, 0x176d3d(%rip) # imm = 0xFFFFFFFF
movq 0x176d3e(%rip), %rax    # 0x49a878
testq %rax, %rax
je 0x323b47
cmpq $0x0, (%rax)
je 0x323b66
popq %rbx
retq
leaq 0xa27ac(%rip), %rdi     # 0x3c62fa
leaq 0xa2629(%rip), %rsi     # 0x3c617e
leaq 0xa27b4(%rip), %rcx     # 0x3c6310
movl $0xb7, %edx
callq 0x2dda0
leaq 0xa27bb(%rip), %rdi     # 0x3c6328
leaq 0xa260a(%rip), %rsi     # 0x3c617e
leaq 0xa2795(%rip), %rcx     # 0x3c6310
movl $0xb8, %edx
callq 0x2dda0
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/tre/lib/xmalloc.c
// Function: xmalloc_dump_leaks
int
xmalloc_dump_leaks(void)
{
  int i;
  int num_leaks = 0;
  int leaked_bytes = 0;
  hashTableItem *item;

  xmalloc_init();

  for (i = 0; i < TABLE_SIZE; i++)
    {
      item = xmalloc_table->table[i];
      while (item != NULL)
	{
	  printf("%s:%d: %s: %d bytes at %p not freed\n",
		 item->file, item->line, item->func, item->bytes, item->ptr);
	  num_leaks++;
	  leaked_bytes += item->bytes;
	  item = item->next;
	}
    }
  if (num_leaks == 0)
    printf("No memory leaks.\n");
  else
    printf("%d unfreed memory chuncks, total %d unfreed bytes.\n",
	   num_leaks, leaked_bytes);
  printf("Peak memory consumption %d bytes (%.1f kB, %.1f MB) in %d blocks ",
	 xmalloc_peak, (double)xmalloc_peak / 1024,
	 (double)xmalloc_peak / (1024*1024), xmalloc_peak_blocks);
  printf("(average ");
  if (xmalloc_peak_blocks)
    printf("%d", ((xmalloc_peak + xmalloc_peak_blocks / 2)
		  / xmalloc_peak_blocks));
  else
    printf("N/A");
  printf(" bytes per block).\n");

  return num_leaks;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
callq 0x323ac4
leaq 0xa253c(%rip), %r14     # 0x3c60d5
xorl %r15d, %r15d
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x176cd1(%rip), %rax    # 0x49a878
movq (%rax), %rax
movq (%rax,%r15,8), %r12
testq %r12, %r12
je 0x323be3
movq 0x10(%r12), %rsi
movl 0x18(%r12), %edx
movq 0x20(%r12), %rcx
movl 0x8(%r12), %r8d
movq (%r12), %r9
movq %r14, %rdi
xorl %eax, %eax
callq 0x2d300
incl %ebx
addl 0x8(%r12), %ebp
movq 0x28(%r12), %r12
jmp 0x323bae
incq %r15
cmpq $0x100, %r15            # imm = 0x100
jne 0x323ba0
testl %ebx, %ebx
je 0x323c07
leaq 0xa2500(%rip), %rdi     # 0x3c60fa
movl %ebx, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2d300
jmp 0x323c13
leaq 0xa27a9(%rip), %rdi     # 0x3c63b7
callq 0x2dbb0
movl 0x176c67(%rip), %esi    # 0x49a880
cvtsi2sd %esi, %xmm1
movsd 0x9a49b(%rip), %xmm0    # 0x3be0c0
mulsd %xmm1, %xmm0
mulsd 0x2eca7(%rip), %xmm1    # 0x3528d8
movl 0x176c4d(%rip), %edx    # 0x49a884
leaq 0xa24f0(%rip), %rdi     # 0x3c612e
movb $0x2, %al
callq 0x2d300
leaq 0xa2524(%rip), %rdi     # 0x3c6170
xorl %eax, %eax
callq 0x2d300
movl 0x176c2b(%rip), %ecx    # 0x49a884
testl %ecx, %ecx
je 0x323c7d
movl %ecx, %eax
shrl %eax
addl 0x176c19(%rip), %eax    # 0x49a880
xorl %edx, %edx
divl %ecx
leaq 0x9dafd(%rip), %rdi     # 0x3c176f
movl %eax, %esi
xorl %eax, %eax
callq 0x2d300
jmp 0x323c8b
leaq 0xa24f6(%rip), %rdi     # 0x3c617a
xorl %eax, %eax
callq 0x2d300
leaq 0xa2736(%rip), %rdi     # 0x3c63c8
callq 0x2dbb0
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/tre/lib/xmalloc.c
// Function: xmalloc_impl
void *
xmalloc_impl(size_t size, const char *file, int line, const char *func)
{
  void *ptr;

  xmalloc_init();
  assert(size > 0);

  if (xmalloc_fail_after == 0)
    {
      xmalloc_fail_after = -2;
#if 0
      printf("xmalloc: forced failure %s:%d: %s\n", file, line, func);
#endif
      return NULL;
    }
  else if (xmalloc_fail_after == -2)
    {
      printf("xmalloc: called after failure from %s:%d: %s\n",
	     file, line, func);
      assert(0);
    }
  else if (xmalloc_fail_after > 0)
    xmalloc_fail_after--;

  ptr = malloc(size);
  if (ptr != NULL)
    hash_table_add(xmalloc_table, ptr, (int)size, file, line, func);
  return ptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
callq 0x323ac4
testq %r15, %r15
je 0x323d20
movl 0x176bab(%rip), %eax    # 0x49a870
testl %eax, %eax
je 0x323d07
cmpl $-0x2, %eax
je 0x323d3f
testl %eax, %eax
jle 0x323cda
decl %eax
movl %eax, 0x176b96(%rip)    # 0x49a870
movq %r15, %rdi
callq 0x32008
movq %rax, %r12
testq %rax, %rax
je 0x323d14
movq 0x176b87(%rip), %rdi    # 0x49a878
movq %r12, %rsi
movl %r15d, %edx
movq %r14, %rcx
movl %ebp, %r8d
movq %rbx, %r9
callq 0x323d74
jmp 0x323d14
movl $0xfffffffe, 0x176b5f(%rip) # imm = 0xFFFFFFFE
xorl %r12d, %r12d
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x300bb(%rip), %rdi     # 0x353de2
leaq 0xa2450(%rip), %rsi     # 0x3c617e
leaq 0xa2468(%rip), %rcx     # 0x3c619d
movl $0xf7, %edx
callq 0x2dda0
leaq 0xa2493(%rip), %rdi     # 0x3c61d9
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2d300
leaq 0x9da24(%rip), %rdi     # 0x3c1780
leaq 0xa241b(%rip), %rsi     # 0x3c617e
leaq 0xa2433(%rip), %rcx     # 0x3c619d
movl $0x105, %edx            # imm = 0x105
callq 0x2dda0
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/tre/lib/xmalloc.c
// Function: hash_table_add
static void
hash_table_add(hashTable *tbl, void *ptr, int bytes,
	       const char *file, int line, const char *func)
{
  int i;
  hashTableItem *item, *new;

  i = hash_void_ptr(ptr);

  item = tbl->table[i];
  if (item != NULL)
    while (item->next != NULL)
      item = item->next;

  new = malloc(sizeof(*new));
  assert(new != NULL);
  new->ptr = ptr;
  new->bytes = bytes;
  new->file = file;
  new->line = line;
  new->func = func;
  new->next = NULL;
  if (item != NULL)
    item->next = new;
  else
    tbl->table[i] = new;

  xmalloc_current += bytes;
  if (xmalloc_current > xmalloc_peak)
    xmalloc_peak = xmalloc_current;
  xmalloc_current_blocks++;
  if (xmalloc_current_blocks > xmalloc_peak_blocks)
    xmalloc_peak_blocks = xmalloc_current_blocks;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movl %r8d, 0xc(%rsp)
movq %rcx, %r15
movl %edx, %ebx
movq %rsi, %r12
xorl %eax, %eax
xorl %ecx, %ecx
xorl %edx, %edx
movq %r12, %rsi
shrq %cl, %rsi
xorl %edx, %esi
addl %eax, %esi
movzbl %sil, %edx
addq $0x8, %rcx
addl $0x11, %eax
cmpq $0x40, %rcx
jne 0x323d9a
movq (%rdi), %r13
movl %edx, %r14d
movq (%r13,%r14,8), %rax
testq %rax, %rax
je 0x323dd3
movq %rax, %rbp
movq 0x28(%rax), %rax
testq %rax, %rax
jne 0x323dc5
jmp 0x323dd5
xorl %ebp, %ebp
movl $0x30, %edi
callq 0x32008
testq %rax, %rax
je 0x323e63
leaq (,%r14,8), %rcx
addq %r13, %rcx
movq %r12, (%rax)
movl %ebx, 0x8(%rax)
movq %r15, 0x10(%rax)
movl 0xc(%rsp), %edx
movl %edx, 0x18(%rax)
movq 0x10(%rsp), %rdx
movq %rdx, 0x20(%rax)
movq $0x0, 0x28(%rax)
leaq 0x28(%rbp), %rdx
testq %rbp, %rbp
cmoveq %rcx, %rdx
movq %rax, (%rdx)
leaq 0x176a62(%rip), %rax    # 0x49a888
addl (%rax), %ebx
movl %ebx, (%rax)
cmpl 0x176a50(%rip), %ebx    # 0x49a880
jle 0x323e38
movl %ebx, 0x176a48(%rip)    # 0x49a880
leaq 0x176a4d(%rip), %rcx    # 0x49a88c
movl (%rcx), %edx
leal 0x1(%rdx), %eax
movl %eax, (%rcx)
cmpl 0x176a38(%rip), %edx    # 0x49a884
jl 0x323e54
movl %eax, 0x176a30(%rip)    # 0x49a884
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa24db(%rip), %rdi     # 0x3c6345
leaq 0xa230d(%rip), %rsi     # 0x3c617e
leaq 0xa24d9(%rip), %rcx     # 0x3c6351
movl $0x6c, %edx
callq 0x2dda0
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/tre/lib/xmalloc.c
// Function: xcalloc_impl
void *
xcalloc_impl(size_t nmemb, size_t size, const char *file, int line,
	     const char *func)
{
  void *ptr;

  xmalloc_init();
  assert(size > 0);

  if (xmalloc_fail_after == 0)
    {
      xmalloc_fail_after = -2;
#if 0
      printf("xcalloc: forced failure %s:%d: %s\n", file, line, func);
#endif
      return NULL;
    }
  else if (xmalloc_fail_after == -2)
    {
      printf("xcalloc: called after failure from %s:%d: %s\n",
	     file, line, func);
      assert(0);
    }
  else if (xmalloc_fail_after > 0)
    xmalloc_fail_after--;

  ptr = calloc(nmemb, size);
  if (ptr != NULL)
    hash_table_add(xmalloc_table, ptr, (int)(nmemb * size), file, line, func);
  return ptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0x323ac4
testq %r15, %r15
je 0x323f13
movl 0x1769c5(%rip), %eax    # 0x49a870
testl %eax, %eax
je 0x323ef4
cmpl $-0x2, %eax
je 0x323f32
testl %eax, %eax
jle 0x323ec0
decl %eax
movl %eax, 0x1769b0(%rip)    # 0x49a870
movq %r12, %rdi
movq %r15, %rsi
callq 0x30ed0
movq %rax, %r13
testq %rax, %rax
je 0x323f01
movq 0x17699e(%rip), %rdi    # 0x49a878
imull %r12d, %r15d
movq %r13, %rsi
movl %r15d, %edx
movq %r14, %rcx
movl %ebp, %r8d
movq %rbx, %r9
callq 0x323d74
jmp 0x323f01
movl $0xfffffffe, 0x176972(%rip) # imm = 0xFFFFFFFE
xorl %r13d, %r13d
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2fec8(%rip), %rdi     # 0x353de2
leaq 0xa225d(%rip), %rsi     # 0x3c617e
leaq 0xa22df(%rip), %rcx     # 0x3c6207
movl $0x117, %edx            # imm = 0x117
callq 0x2dda0
leaq 0xa2312(%rip), %rdi     # 0x3c624b
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2d300
leaq 0x9d831(%rip), %rdi     # 0x3c1780
leaq 0xa2228(%rip), %rsi     # 0x3c617e
leaq 0xa22aa(%rip), %rcx     # 0x3c6207
movl $0x125, %edx            # imm = 0x125
callq 0x2dda0
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/tre/lib/xmalloc.c
// Function: xfree_impl
void
xfree_impl(void *ptr, const char *file, int line, const char *func)
{
  /*LINTED*/(void)&file;
  /*LINTED*/(void)&line;
  /*LINTED*/(void)&func;
  xmalloc_init();

  if (ptr != NULL)
    hash_table_del(xmalloc_table, ptr);
  free(ptr);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x323ac4
testq %rbx, %rbx
je 0x323f84
movq 0x1768fc(%rip), %rdi    # 0x49a878
movq %rbx, %rsi
callq 0x323f8d
movq %rbx, %rdi
popq %rbx
jmp 0x32018
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/tre/lib/xmalloc.c
// Function: hash_table_del
static void
hash_table_del(hashTable *tbl, void *ptr)
{
  int i;
  hashTableItem *item, *prev;

  i = hash_void_ptr(ptr);

  item = tbl->table[i];
  if (item == NULL)
    {
      printf("xfree: invalid ptr %p\n", ptr);
      abort();
    }
  prev = NULL;
  while (item->ptr != ptr)
    {
      prev = item;
      item = item->next;
    }
  if (item->ptr != ptr)
    {
      printf("xfree: invalid ptr %p\n", ptr);
      abort();
    }

  xmalloc_current -= item->bytes;
  xmalloc_current_blocks--;

  if (prev != NULL)
    {
      prev->next = item->next;
      free(item);
    }
  else
    {
      tbl->table[i] = item->next;
      free(item);
    }
}

// Assembly:
pushq %rax
xorl %eax, %eax
xorl %ecx, %ecx
xorl %edx, %edx
movq %rsi, %r8
shrq %cl, %r8
xorl %edx, %r8d
addl %eax, %r8d
movzbl %r8b, %edx
addq $0x8, %rcx
addl $0x11, %eax
cmpq $0x40, %rcx
jne 0x323f94
movq (%rdi), %rax
movl %edx, %ecx
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0x324005
leaq (%rax,%rcx,8), %rax
cmpq %rsi, (%rdi)
je 0x323fd6
movq %rdi, %rcx
movq 0x28(%rdi), %rdi
cmpq %rsi, (%rdi)
jne 0x323fc8
jmp 0x323fd8
xorl %ecx, %ecx
movl 0x8(%rdi), %edx
leaq 0x1768a6(%rip), %rsi    # 0x49a888
subl %edx, (%rsi)
leaq 0x1768a1(%rip), %rdx    # 0x49a88c
decl (%rdx)
leaq 0x28(%rcx), %rdx
testq %rcx, %rcx
movq 0x28(%rdi), %rcx
cmoveq %rax, %rdx
movq %rcx, (%rdx)
popq %rax
jmp 0x32018
leaq 0xa2394(%rip), %rdi     # 0x3c63a0
xorl %eax, %eax
callq 0x2d300
callq 0x2d820
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/tre/lib/xmalloc.c
// Function: xrealloc_impl
void *
xrealloc_impl(void *ptr, size_t new_size, const char *file, int line,
	      const char *func)
{
  void *new_ptr;

  xmalloc_init();
  assert(ptr != NULL);
  assert(new_size > 0);

  if (xmalloc_fail_after == 0)
    {
      xmalloc_fail_after = -2;
      return NULL;
    }
  else if (xmalloc_fail_after == -2)
    {
      printf("xrealloc: called after failure from %s:%d: %s\n",
	     file, line, func);
      assert(0);
    }
  else if (xmalloc_fail_after > 0)
    xmalloc_fail_after--;

  hash_table_del(xmalloc_table, ptr);
  new_ptr = realloc(ptr, new_size);
  if (new_ptr != NULL)
    {
      hash_table_add(xmalloc_table, new_ptr, (int)new_size, file, line, func);
    }
  return new_ptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0x323ac4
testq %r12, %r12
je 0x3240bc
testq %r15, %r15
je 0x3240db
movl 0x176825(%rip), %eax    # 0x49a870
testl %eax, %eax
je 0x3240a3
cmpl $-0x2, %eax
je 0x3240fa
testl %eax, %eax
jle 0x324064
decl %eax
movl %eax, 0x17680c(%rip)    # 0x49a870
movq 0x17680d(%rip), %rdi    # 0x49a878
movq %r12, %rsi
callq 0x323f8d
movq %r12, %rdi
movq %r15, %rsi
callq 0x32068
movq %rax, %r12
testq %rax, %rax
je 0x3240b0
movq 0x1767eb(%rip), %rdi    # 0x49a878
movq %r12, %rsi
movl %r15d, %edx
movq %r14, %rcx
movl %ebp, %r8d
movq %rbx, %r9
callq 0x323d74
jmp 0x3240b0
movl $0xfffffffe, 0x1767c3(%rip) # imm = 0xFFFFFFFE
xorl %r12d, %r12d
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7bc25(%rip), %rdi     # 0x39fce8
leaq 0xa20b4(%rip), %rsi     # 0x3c617e
leaq 0xa21a8(%rip), %rcx     # 0x3c6279
movl $0x144, %edx            # imm = 0x144
callq 0x2dda0
leaq 0xa21dc(%rip), %rdi     # 0x3c62be
leaq 0xa2095(%rip), %rsi     # 0x3c617e
leaq 0xa2189(%rip), %rcx     # 0x3c6279
movl $0x145, %edx            # imm = 0x145
callq 0x2dda0
leaq 0xa21ca(%rip), %rdi     # 0x3c62cb
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2d300
leaq 0x9d669(%rip), %rdi     # 0x3c1780
leaq 0xa2060(%rip), %rsi     # 0x3c617e
leaq 0xa2154(%rip), %rcx     # 0x3c6279
movl $0x150, %edx            # imm = 0x150
callq 0x2dda0
nop
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/zlib-1.3.0.1/compress.c
// Function: compress2
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
                      uLong sourceLen, int level) {
    z_stream stream;
    int err;
    const uInt max = (uInt)-1;
    uLong left;

    left = *destLen;
    *destLen = 0;

    stream.zalloc = (alloc_func)0;
    stream.zfree = (free_func)0;
    stream.opaque = (voidpf)0;

    err = deflateInit(&stream, level);
    if (err != Z_OK) return err;

    stream.next_out = dest;
    stream.avail_out = 0;
    stream.next_in = (z_const Bytef *)source;
    stream.avail_in = 0;

    do {
        if (stream.avail_out == 0) {
            stream.avail_out = left > (uLong)max ? max : (uInt)left;
            left -= stream.avail_out;
        }
        if (stream.avail_in == 0) {
            stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
            sourceLen -= stream.avail_in;
        }
        err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH);
    } while (err == Z_OK);

    *destLen = stream.total_out;
    deflateEnd(&stream);
    return err == Z_STREAM_END ? Z_OK : err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r13
movq (%rsi), %r12
xorl %ebp, %ebp
movq %rbp, (%rsi)
leaq 0x8(%rsp), %rdi
movq %rbp, 0x50(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
leaq 0x92522(%rip), %rdx     # 0x3c0c1b
movl %r8d, %esi
movl $0x70, %ecx
callq 0x3309d0
testl %eax, %eax
jne 0x32e792
movq %r15, %rax
leaq 0x8(%rsp), %r15
movq %r13, 0x18(%r15)
movl %ebp, 0x20(%r15)
movq %rax, (%r15)
movl %ebp, 0x8(%r15)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl $0x0, 0x28(%rsp)
jne 0x32e745
cmpq %r13, %r12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovbq %r12, %rax
movl %eax, 0x28(%rsp)
subq %rax, %r12
cmpl $0x0, 0x10(%rsp)
jne 0x32e75f
cmpq %r13, %r14
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovbq %r14, %rax
movl %eax, 0x10(%rsp)
subq %rax, %r14
xorl %esi, %esi
testq %r14, %r14
sete %sil
shll $0x2, %esi
movq %r15, %rdi
callq 0x33164a
testl %eax, %eax
je 0x32e72b
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
movq 0x28(%rdi), %rax
movq %rax, (%rbx)
callq 0x330ccd
xorl %eax, %eax
cmpl $0x1, %ebp
cmovnel %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/zlib-1.3.0.1/infback.c
// Function: inflateBackInit_
int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,
                             unsigned char FAR *window, const char *version,
                             int stream_size) {
    struct inflate_state FAR *state;

    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
        stream_size != (int)(sizeof(z_stream)))
        return Z_VERSION_ERROR;
    if (strm == Z_NULL || window == Z_NULL ||
        windowBits < 8 || windowBits > 15)
        return Z_STREAM_ERROR;
    strm->msg = Z_NULL;                 /* in case we return an error */
    if (strm->zalloc == (alloc_func)0) {
#ifdef Z_SOLO
        return Z_STREAM_ERROR;
#else
        strm->zalloc = zcalloc;
        strm->opaque = (voidpf)0;
#endif
    }
    if (strm->zfree == (free_func)0)
#ifdef Z_SOLO
        return Z_STREAM_ERROR;
#else
    strm->zfree = zcfree;
#endif
    state = (struct inflate_state FAR *)ZALLOC(strm, 1,
                                               sizeof(struct inflate_state));
    if (state == Z_NULL) return Z_MEM_ERROR;
    Tracev((stderr, "inflate: allocated\n"));
    strm->state = (struct internal_state FAR *)state;
    state->dmax = 32768U;
    state->wbits = (uInt)windowBits;
    state->wsize = 1U << windowBits;
    state->window = window;
    state->wnext = 0;
    state->whave = 0;
    state->sane = 1;
    return Z_OK;
}

// Assembly:
movl $0xfffffffa, %eax       # imm = 0xFFFFFFFA
testq %rcx, %rcx
je 0x338141
cmpl $0x70, %r8d
jne 0x338141
cmpb $0x31, (%rcx)
jne 0x338141
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
leal -0x10(%r14), %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl $-0x8, %ecx
jb 0x338137
movq %rdi, %r15
testq %rdi, %rdi
je 0x338137
movq %rdx, %rbx
testq %rdx, %rdx
je 0x338137
movq $0x0, 0x30(%r15)
cmpq $0x0, 0x40(%r15)
jne 0x3380d3
leaq -0x22dc(%rip), %rax     # 0x335deb
movq %rax, 0x40(%r15)
movq $0x0, 0x50(%r15)
cmpq $0x0, 0x48(%r15)
jne 0x3380e5
leaq -0x22ec(%rip), %rax     # 0x335df5
movq %rax, 0x48(%r15)
movq 0x50(%r15), %rdi
movl $0x1, %ebp
movl $0x1, %esi
movl $0x1bf8, %edx           # imm = 0x1BF8
callq *0x40(%r15)
testq %rax, %rax
je 0x338132
movq %rax, 0x38(%r15)
movl $0x8000, 0x1c(%rax)     # imm = 0x8000
movl %r14d, 0x38(%rax)
movl %r14d, %ecx
shll %cl, %ebp
movl %ebp, 0x3c(%rax)
movq %rbx, 0x48(%rax)
movq $0x0, 0x40(%rax)
movl $0x1, 0x1be8(%rax)
xorl %eax, %eax
jmp 0x338137
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/zlib-1.3.0.1/infback.c
// Function: inflateBackEnd
int ZEXPORT inflateBackEnd(z_streamp strm) {
    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
        return Z_STREAM_ERROR;
    ZFREE(strm, strm->state);
    strm->state = Z_NULL;
    Tracev((stderr, "inflate: end\n"));
    return Z_OK;
}

// Assembly:
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testq %rdi, %rdi
je 0x33907e
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rsi
testq %rsi, %rsi
je 0x33907d
movq 0x48(%rbx), %rcx
testq %rcx, %rcx
je 0x33907d
movq 0x50(%rbx), %rdi
callq *%rcx
movq $0x0, 0x38(%rbx)
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/dynamodb-kv/capacity.c
// Function: capacity_init
struct capacity_reader *
capacity_init(const char * key_id, const char * key_secret,
    const char * tname, const char * rname, struct serverpool * SP,
    struct dynamodb_request_queue * QW, struct dynamodb_request_queue * QR)
{
	struct capacity_reader * M;

	/* Allocate space for our state and copy in parameters. */
	if ((M = malloc(sizeof(struct capacity_reader))) == NULL)
		goto err0;
	if ((M->key_id = strdup(key_id)) == NULL)
		goto err1;
	if ((M->key_secret = strdup(key_secret)) == NULL)
		goto err2;
	M->tname = tname;
	M->rname = rname;
	M->SP = SP;
	M->QW = QW;
	M->QR = QR;

	/* Initialize internal state. */
	M->ddbreq = NULL;
	M->addrs[0] = M->addrs[1] = NULL;
	M->http_cookie = NULL;
	M->timer_cookie = NULL;
	M->done = 0;

	/* Start reading table metadata. */
	if (readmetadata(M))
		goto err3;

	/* Wait for response. */
	if (events_spin(&M->done))
		goto err0;

	/* Success! */
	return (M);

err3:
	insecure_memzero(M->key_secret, strlen(M->key_secret));
err2:
	free(M->key_id);
err1:
	free(M);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
movl $0x68, %edi
callq 0x34d0
testq %rax, %rax
je 0x47ef
movq %rax, %rbx
movq %r14, %rdi
callq 0x3610
movq %rax, (%rbx)
testq %rax, %rax
je 0x47e7
movq %rbp, %rdi
callq 0x3610
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x47df
movq 0x40(%rsp), %rax
movq %r13, 0x10(%rbx)
movq %r12, 0x18(%rbx)
movq %r15, 0x20(%rbx)
movq (%rsp), %rcx
movq %rcx, 0x28(%rbx)
movq %rax, 0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x54(%rbx)
movq %rbx, %rdi
callq 0x4815
testl %eax, %eax
je 0x4803
movq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x3180
leaq 0x18eac(%rip), %rcx     # 0x1d680
movq (%rcx), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq *%rcx
movq (%rbx), %rdi
callq 0x3460
movq %rbx, %rdi
callq 0x3460
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
addq $0x60, %rdi
callq 0x5ae9
testl %eax, %eax
jne 0x47ef
jmp 0x47f1
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/dynamodb-kv/capacity.c
// Function: readmetadata
static int
readmetadata(struct capacity_reader * M)
{

	/* Construct the DynamoDB request body. */
	if (asprintf(&M->ddbreq, "{\"TableName\":\"%s\"}", M->tname) == -1) {
		warnp("asprintf");
		goto err0;
	}

	/* Get an address. */
	if ((M->addrs[0] = serverpool_pick(M->SP)) == NULL)
		goto err1;

	/* Send the request. */
	if ((M->http_cookie = dynamodb_request(M->addrs, M->key_id,
	    M->key_secret, M->rname, "DescribeTable",
	    (const uint8_t *)M->ddbreq, strlen(M->ddbreq), 4096,
	    callback_readmetadata, M)) == NULL)
		goto err2;

	/* Success! */
	return (0);

err2:
	sock_addr_free(M->addrs[0]);
	M->addrs[0] = NULL;
err1:
	free(M->ddbreq);
	M->ddbreq = NULL;
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x38(%rdi), %rbx
movq 0x10(%rdi), %rdx
leaq 0xfafb(%rip), %rsi      # 0x14330
movq %rbx, %rdi
xorl %eax, %eax
callq 0x93a4
cmpl $-0x1, %eax
je 0x48e4
movq 0x20(%r14), %rdi
callq 0xe5d1
movq %rax, 0x40(%r14)
testq %rax, %rax
je 0x48d3
leaq 0x40(%r14), %r12
movq (%r14), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%r14), %r13
movq 0x18(%r14), %rbp
movq 0x38(%r14), %r15
movq %r15, %rdi
callq 0x3180
leaq 0x10f(%rip), %r10       # 0x4990
leaq 0xfabb(%rip), %r8       # 0x14343
movq %r12, 0x8(%rsp)
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movq %r13, %rdx
movq %rbp, %rcx
movq %r15, %r9
pushq %r14
pushq %r10
pushq $0x1000                 # imm = 0x1000
pushq %rax
callq 0xc5f6
addq $0x20, %rsp
movq %rax, %rcx
movq %rax, 0x50(%r14)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x491a
movq 0x8(%rsp), %r14
movq (%r14), %rdi
callq 0xaed7
movq $0x0, (%r14)
movq (%rbx), %rdi
callq 0x3460
movq $0x0, (%rbx)
jmp 0x4915
callq 0x3040
cmpl $0x0, (%rax)
je 0x4907
movq %rax, %rbx
leaq 0xf7d7(%rip), %rdi      # 0x140cf
xorl %eax, %eax
callq 0xb884
movl $0x0, (%rbx)
jmp 0x4915
leaq 0xf7c1(%rip), %rdi      # 0x140cf
xorl %eax, %eax
callq 0xb9a3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/dynamodb-kv/capacity.c
// Function: capacity_free
void
capacity_free(struct capacity_reader * M)
{

	/* Behave consistently with free(NULL). */
	if (M == NULL)
		return;

	/* Cancel HTTP request and pending timer, if they exist. */
	if (M->http_cookie)
		http_request_cancel(M->http_cookie);
	if (M->timer_cookie)
		events_timer_cancel(M->timer_cookie);

	/* Free the AWS keys. */
	insecure_memzero(M->key_secret, strlen(M->key_secret));
	free(M->key_secret);
	free(M->key_id);

	/* Free our cookie. */
	free(M);
}

// Assembly:
testq %rdi, %rdi
je 0x498f
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x50(%rdi), %rdi
testq %rdi, %rdi
je 0x4943
callq 0x6f8d
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x4951
callq 0x6ae5
movq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x3180
leaq 0x18d1c(%rip), %rcx     # 0x1d680
movq (%rcx), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq *%rcx
movq 0x8(%rbx), %rdi
callq 0x3460
movq (%rbx), %rdi
callq 0x3460
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3460
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/dynamodb-kv/dispatch.c
// Function: dispatch_accept
struct dispatch_state *
dispatch_accept(struct dynamodb_request_queue * QW,
    struct dynamodb_request_queue * QR, const char * table, int s)
{
	struct dispatch_state * D;

	/* Allocate space for dispatcher state. */
	if ((D = malloc(sizeof(struct dispatch_state))) == NULL)
		goto err0;

	/* Initialize dispatcher. */
	D->QW = QW;
	D->QR = QR;
	D->table = table;
	D->ip_head = D->ip_tail = NULL;

	/* Accept a connection. */
	D->accepting = 1;
	if (network_accept(s, callback_accept, D) == NULL)
		goto err1;

	/* Success! */
	return (D);

err1:
	free(D);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0x48, %edi
callq 0x34d0
testq %rax, %rax
je 0x4d0c
movq %rax, %rbx
movq %r12, (%rax)
movq %r15, 0x8(%rax)
movq %r14, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movl $0x1, 0x28(%rax)
leaq 0x25(%rip), %rsi        # 0x4d1a
movl %ebp, %edi
movq %rax, %rdx
callq 0x8488
testq %rax, %rax
jne 0x4d0e
movq %rbx, %rdi
callq 0x3460
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/dynamodb-kv/dispatch.c
// Function: dispatch_done
int
dispatch_done(struct dispatch_state * D)
{

	/* Sanity check. */
	assert(D->accepting == 0);
	assert(D->read_cookie == NULL);
	assert(D->ip_head == NULL);
	assert(D->ip_tail == NULL);

	/* Free the buffered reader for the connection. */
	netbuf_read_free(D->readq);

	/* Free the buffered writer for the connection. */
	netbuf_write_free(D->writeq);

	/* Close the connection. */
	if (close(D->sconn))
		warnp("close");

	/* Free allocated memory. */
	free(D);

	/* Success! */
	return (0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x28(%rdi)
jne 0x4fa7
movq %rdi, %rbx
cmpq $0x0, 0x40(%rdi)
jne 0x4fc6
cmpq $0x0, 0x18(%rbx)
jne 0x4fe5
cmpq $0x0, 0x20(%rbx)
jne 0x5004
movq 0x38(%rbx), %rdi
callq 0x7f1c
movq 0x30(%rbx), %rdi
callq 0x8307
movl 0x2c(%rbx), %edi
callq 0x3670
testl %eax, %eax
je 0x4f95
callq 0x3040
cmpl $0x0, (%rax)
je 0x4f87
movq %rax, %r14
leaq 0xf7b5(%rip), %rdi      # 0x1472c
xorl %eax, %eax
callq 0xb884
movl $0x0, (%r14)
jmp 0x4f95
leaq 0xf79e(%rip), %rdi      # 0x1472c
xorl %eax, %eax
callq 0xb9a3
movq %rbx, %rdi
callq 0x3460
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xf4c7(%rip), %rdi      # 0x14475
leaq 0xf4d2(%rip), %rsi      # 0x14487
leaq 0xf4d6(%rip), %rcx      # 0x14492
movl $0x1be, %edx            # imm = 0x1BE
callq 0x3210
leaq 0xf4f0(%rip), %rdi      # 0x144bd
leaq 0xf4b3(%rip), %rsi      # 0x14487
leaq 0xf4b7(%rip), %rcx      # 0x14492
movl $0x1bf, %edx            # imm = 0x1BF
callq 0x3210
leaq 0xf4e8(%rip), %rdi      # 0x144d4
leaq 0xf494(%rip), %rsi      # 0x14487
leaq 0xf498(%rip), %rcx      # 0x14492
movl $0x1c0, %edx            # imm = 0x1C0
callq 0x3210
leaq 0xf4dc(%rip), %rdi      # 0x144e7
leaq 0xf475(%rip), %rsi      # 0x14487
leaq 0xf479(%rip), %rcx      # 0x14492
movl $0x1c1, %edx            # imm = 0x1C1
callq 0x3210
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/dynamodb-kv/dispatch.c
// Function: request_dequeue
static void
request_dequeue(struct dispatch_state * D, struct request * R)
{

	/* Sanity-check linked list. */
	assert(D == R->D);

	/* Free the contents of the kivaloo-dynamodb-kv request. */
	proto_dynamodb_kv_request_free(&R->R);

	/* Free the DynamoDB request body we constructed. */
	free(R->body);

	/* Remove from the linked list. */
	if (D->ip_head == R) {
		assert(R->prev == NULL);
		D->ip_head = R->next;
	} else {
		assert(R->prev != NULL);
		R->prev->next = R->next;
	}
	if (D->ip_tail == R) {
		assert(R->next == NULL);
		D->ip_tail = R->prev;
	} else {
		assert(R->next != NULL);
		R->next->prev = R->prev;
	}

	/* Free the request structure. */
	free(R);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq %rdi, (%rsi)
jne 0x538e
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsi), %rdi
callq 0xde74
movq 0x50(%rbx), %rdi
callq 0x3460
movq 0x8(%rbx), %rax
cmpq %rbx, 0x18(%r14)
je 0x5344
testq %rax, %rax
je 0x53ad
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x5355
testq %rax, %rax
jne 0x53eb
movq 0x10(%rbx), %rax
movq %rax, 0x18(%r14)
movq 0x10(%rbx), %rax
cmpq %rbx, 0x20(%r14)
je 0x536e
testq %rax, %rax
je 0x53cc
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rax)
jmp 0x537f
testq %rax, %rax
jne 0x540a
movq 0x8(%rbx), %rax
movq %rax, 0x20(%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3460
leaq 0xf20b(%rip), %rdi      # 0x145a0
leaq 0xf0eb(%rip), %rsi      # 0x14487
leaq 0xf207(%rip), %rcx      # 0x145aa
movl $0x3a, %edx
callq 0x3210
leaq 0xf246(%rip), %rdi      # 0x145fa
leaq 0xf0cc(%rip), %rsi      # 0x14487
leaq 0xf1e8(%rip), %rcx      # 0x145aa
movl $0x47, %edx
callq 0x3210
leaq 0xf247(%rip), %rdi      # 0x1461a
leaq 0xf0ad(%rip), %rsi      # 0x14487
leaq 0xf1c9(%rip), %rcx      # 0x145aa
movl $0x4e, %edx
callq 0x3210
leaq 0xf1f8(%rip), %rdi      # 0x145ea
leaq 0xf08e(%rip), %rsi      # 0x14487
leaq 0xf1aa(%rip), %rcx      # 0x145aa
movl $0x44, %edx
callq 0x3210
leaq 0xf1f9(%rip), %rdi      # 0x1460a
leaq 0xf06f(%rip), %rsi      # 0x14487
leaq 0xf18b(%rip), %rcx      # 0x145aa
movl $0x4b, %edx
callq 0x3210
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/dynamodb-kv/dispatch.c
// Function: callback_response
static int
callback_response(void * cookie, struct http_response * res, const char * err)
{
	struct request * R = cookie;
	struct dispatch_state * D = R->D;
	uint8_t * vbuf;
	uint32_t vlen;
	int status;

	/* Did we succeed? */
	switch (res->status) {
	case 200:
		status = 0;
		break;
	case 400:
		if (strcmp(err, "ConditionalCheckFailedException") == 0)
			status = 2;
		else
			status = 1;
		break;
	default:
		status = 1;
		break;
	}

	/* Send appropriate response back to the client. */
	switch (R->R.type) {
	case PROTO_DDBKV_PUT:
	case PROTO_DDBKV_ICAS:
	case PROTO_DDBKV_CREATE:
	case PROTO_DDBKV_DELETE:	/* Has same response as PUT. */
		if (proto_dynamodb_kv_response_put(D->writeq, R->R.ID,
		    status))
			goto err1;
		break;
	case PROTO_DDBKV_GET:
	case PROTO_DDBKV_GETC:		/* Has same response as GET. */
		/* Extract the value. */
		if (dynamodb_kv_extractv(res->body, res->bodylen,
		    &vbuf, &vlen))
			goto err1;

		/* A success without data is a status of 2. */
		if ((status == 0) && (vbuf == NULL))
			status = 2;

		/* Send a response back. */
		if (proto_dynamodb_kv_response_get(D->writeq, R->R.ID,
		    status, vlen, vbuf))
			goto err2;

		/* Free the value. */
		free(vbuf);
		break;
	}

	/* Free the response body buffer. */
	free(res->body);

	/* Remove this request from the in-progress list. */
	request_dequeue(D, R);

	/* Success! */
	return (0);

err2:
	free(vbuf);
err1:
	free(res->body);
	request_dequeue(D, R);

	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %r14
movl (%rsi), %eax
xorl %ebp, %ebp
cmpl $0xc8, %eax
je 0x5473
cmpl $0x190, %eax            # imm = 0x190
jne 0x547b
leaq 0xf208(%rip), %rsi      # 0x14661
movq %rdx, %rdi
callq 0x3520
xorl %r13d, %r13d
cmpl $0x1, %eax
movl $0x0, %r12d
adcl $0x1, %r12d
jmp 0x5484
movb $0x1, %r13b
xorl %r12d, %r12d
jmp 0x5484
movl $0x1, %r12d
xorl %r13d, %r13d
movl $0xfffeff00, %eax       # imm = 0xFFFEFF00
addl 0x20(%rbx), %eax
cmpl $0x20, %eax
ja 0x5521
movabsq $0x100000007, %rcx      # imm = 0x100000007
btq %rax, %rcx
jae 0x54bb
movq 0x30(%r14), %rdi
movq 0x18(%rbx), %rsi
movl %r12d, %edx
callq 0xdeac
testl %eax, %eax
jne 0x551c
jmp 0x5521
movl $0x30000, %ecx          # imm = 0x30000
btq %rax, %rcx
jae 0x5521
movq 0x18(%r15), %rsi
movq 0x20(%r15), %rdi
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
callq 0xc3ff
testl %eax, %eax
jne 0x551c
movq 0x10(%rsp), %r8
testq %r8, %r8
movl $0x2, %edx
cmovnel %r12d, %edx
testb %r13b, %r13b
cmovel %r12d, %edx
movq 0x30(%r14), %rdi
movq 0x18(%rbx), %rsi
movl 0xc(%rsp), %ecx
callq 0xdf18
movl %eax, %r12d
movq 0x10(%rsp), %rdi
callq 0x3460
testl %r12d, %r12d
je 0x5521
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x20(%r15), %rdi
callq 0x3460
movq %r14, %rdi
movq %rbx, %rsi
callq 0x530a
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop