LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/helper.c
// Function: dvfs_scale_up
int
dvfs_scale_up(const size_t n_reps, const double ratio, double* dur)
{
  const double is_dvfs_ratio = 0.9;
  const uint max_tries = 16;
  uint tries = max_tries;

  clock_t s = clock();
  ticks times[2];
  times[0] = spin_time(n_reps);
  times[1] = spin_time(n_reps);
  ticks prev = times[1], last = prev;
  if (times[1] < (ratio * times[0]))
    {
      ticks cmp = prev;
      do
	{
	  cmp = prev;
	  last = spin_time(n_reps);
	  prev = last;
	}
      while (tries-- > 0 && last < (ratio * cmp));
    }
  clock_t e = clock();

  if (dur != NULL)
    {
      *dur = 1000.0 * (e - s) / (double) CLOCKS_PER_SEC;
    }
  return (last < (is_dvfs_ratio * times[0]));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movsd %xmm0, 0x8(%rsp)
movq %rdi, %r15
callq 0x20d0
movq %rax, %r14
movq %r15, %rdi
callq 0x5dcb
movq %rax, %r13
movq %r15, %rdi
callq 0x5dcb
movq %rax, %r12
movq %rax, %xmm0
movq 0x51ee(%rip), %xmm2     # 0xb050
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x51f2(%rip), %xmm3     # 0xb060
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movq %r13, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
movapd %xmm2, 0x10(%rsp)
movapd %xmm2, %xmm0
mulsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x5f14
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
movq %r15, %rdi
callq 0x5dcb
movq %rax, %r13
incl %ebp
je 0x5f17
movq %r13, %xmm0
movq 0x5182(%rip), %xmm2     # 0xb050
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x5186(%rip), %xmm3     # 0xb060
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movq %r12, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
mulsd 0x8(%rsp), %xmm2
ucomisd %xmm1, %xmm2
movq %r13, %r12
ja 0x5eb2
jmp 0x5f17
movq %r12, %r13
callq 0x20d0
testq %rbx, %rbx
je 0x5f40
subq %r14, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x692c(%rip), %xmm0     # 0xc860
divsd 0x50dc(%rip), %xmm0     # 0xb018
movsd %xmm0, (%rbx)
movq %r13, %xmm0
punpckldq 0x5103(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x510b(%rip), %xmm0     # 0xb060
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
movapd 0x10(%rsp), %xmm2
mulsd 0x50bd(%rip), %xmm2     # 0xb028
addsd %xmm0, %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm2
seta %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/barrier.c
// Function: barrier2_create
barrier2_t*
barrier2_create()
{
  barrier2_t* b = (barrier2_t*) malloc(sizeof(barrier2_t));
  assert(b);
  for (int i = 0; i < BARRIER2_NUM_BARRIER; i++)
    {
      b->val[i] = 0;
      b->eval[i] = 0;
    }
  return b;
}

// Assembly:
pushq %rax
movl $0x80, %edi
callq 0x21d0
testq %rax, %rax
je 0x5fae
xorl %ecx, %ecx
xorl %edx, %edx
movl %ecx, (%rax,%rdx,4)
movl %ecx, 0x40(%rax,%rdx,4)
incq %rdx
cmpq $0x10, %rdx
jne 0x5f9c
popq %rcx
retq
leaq 0x690c(%rip), %rdi      # 0xc8c1
leaq 0x6907(%rip), %rsi      # 0xc8c3
leaq 0x690e(%rip), %rcx      # 0xc8d1
movl $0x7, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/cdf.c
// Function: cdf_cluster_get_min_latency
uint64_t
cdf_cluster_get_min_latency(cdf_cluster_t* cc)
{
  uint64_t min_lat = cc->clusters[0].median;
  for (int i = 1; i < cc->n_clusters; i++)
    {
      if (min_lat == 0 || (cc->clusters[i].median < min_lat))
	{
	  min_lat = cc->clusters[i].median;
	}
    }
  return min_lat;
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
movq 0x20(%rdx), %rax
cmpq $0x2, %rcx
jb 0x659c
addq $0x48, %rdx
decq %rcx
testq %rax, %rax
je 0x6590
cmpq %rax, (%rdx)
jae 0x6593
movq (%rdx), %rax
addq $0x28, %rdx
decq %rcx
jne 0x6586
retq
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/cdf.c
// Function: cdf_cluster_print
void
cdf_cluster_print(cdf_cluster_t* cc)
{
  printf("## CDF Clusters ##############################################\n");
  for (int i = 0; i < cc->n_clusters; i++)
    {
      printf("#### #%-3d : size %-5zu / range %-5zu - %-5zu / median: %-5zu #\n",
	     cc->clusters[i].idx, 
	     cc->clusters[i].size, 
	     cc->clusters[i].val_min, 
	     cc->clusters[i].val_max, 
	     cc->clusters[i].median);
    }
  printf("##############################################################\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6436(%rip), %rdi      # 0xca40
callq 0x2080
cmpq $0x0, (%rbx)
je 0x6657
movl $0x20, %r15d
leaq 0x638c(%rip), %r14      # 0xc9ae
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movl -0x20(%rax,%r15), %esi
movq -0x18(%rax,%r15), %rdx
movq -0x10(%rax,%r15), %rcx
movq -0x8(%rax,%r15), %r8
movq (%rax,%r15), %r9
movq %r14, %rdi
xorl %eax, %eax
callq 0x2100
incq %r12
addq $0x28, %r15
cmpq %r12, (%rbx)
ja 0x6625
leaq 0x60d9(%rip), %rdi      # 0xc737
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2080
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/cdf.c
// Function: cdf_cluster_value_to_cluster_median
inline uint64_t
cdf_cluster_value_to_cluster_median(cdf_cluster_t* cc, const uint64_t val)
{
  for (int i = 0; i < cc->n_clusters; i++)
    {
      if (val >= cc->clusters[i].val_min && val <= cc->clusters[i].val_max)
	{
	  return cc->clusters[i].median;
	}
    }

  fprintf(stderr, "[ERROR] Value %zu does not belong to cdf_cluster\n", val);
  return 0;
}

// Assembly:
pushq %rbx
movq %rsi, %rdx
movq (%rdi), %rcx
testq %rcx, %rcx
setne %al
je 0x66b9
movq 0x8(%rdi), %rsi
addq $0x20, %rsi
movq %rcx, %rdi
negq %rdi
movl $0x1, %r8d
cmpq %rdx, -0x10(%rsi)
ja 0x669d
cmpq %rdx, -0x8(%rsi)
jae 0x66bb
cmpq %r8, %rcx
seta %al
addq $0x28, %rsi
leaq (%rdi,%r8), %r9
incq %r9
incq %r8
cmpq $0x1, %r9
jne 0x6691
jmp 0x66be
jmp 0x66be
movq (%rsi), %rbx
testb $0x1, %al
je 0x66c7
movq %rbx, %rax
popq %rbx
retq
movq 0xa922(%rip), %rax      # 0x10ff0
movq (%rax), %rdi
leaq 0x6317(%rip), %rsi      # 0xc9ef
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2170
jmp 0x66c2
nop
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/darray.c
// Function: darray_create
darray_t*
darray_create()
{
  darray_t* da = malloc_assert(sizeof(darray_t));
  da->n_elems = 0;
  da->size = DARRAY_MIN_SIZE;
  da->array = malloc_assert(DARRAY_MIN_SIZE * sizeof(uintptr_t));
  return da;
}

// Assembly:
pushq %rbx
movl $0x18, %edi
callq 0x21d0
testq %rax, %rax
je 0x671e
movq %rax, %rbx
movq $0x0, (%rax)
movq $0x8, 0x8(%rax)
movl $0x40, %edi
callq 0x21d0
testq %rax, %rax
je 0x671e
movq %rax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
leaq 0x6c23(%rip), %rdi      # 0xd348
leaq 0x53d3(%rip), %rsi      # 0xbaff
leaq 0x53e5(%rip), %rcx      # 0xbb18
movl $0x59, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/darray.c
// Function: darray_add_double
void
darray_add_double(darray_t* da, double elem)
{
  DARRAY_RESIZE(da);
  uintptr_t* ptr = da->array + da->n_elems++;
  double* ptrd = (double*) ptr;
  *ptrd = elem;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
cmpq %rsi, (%rdi)
je 0x6857
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movsd %xmm0, (%rcx,%rax,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq (%rsi,%rsi), %r14
movq 0x10(%rbx), %rdi
shlq $0x4, %rsi
movsd %xmm0, (%rsp)
callq 0x6800
movsd (%rsp), %xmm0
movq %rax, 0x10(%rbx)
movq %r14, 0x8(%rbx)
jmp 0x683c
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/darray.c
// Function: darray_remove
int
darray_remove(darray_t* da, uintptr_t elem)
{
  for (int i = 0; i < da->n_elems; i++)
    {
      if (unlikely(elem == da->array[i]))
	{
	  da->n_elems--;
	  for (int j = i; j < da->n_elems; j++)
	    {
	      da->array[j] = da->array[j + 1];
	    }
	  return 1;
	}
    }
  return 0;
}

// Assembly:
movq (%rdi), %rdx
testq %rdx, %rdx
setne %cl
je 0x692d
movq 0x10(%rdi), %rax
cmpq %rsi, (%rax)
je 0x6931
leaq -0x1(%rdx), %rcx
xorl %r9d, %r9d
cmpq %r9, %rcx
je 0x692b
leaq 0x1(%r9), %r8
cmpq %rsi, 0x8(%rax,%r9,8)
movq %r8, %r9
jne 0x6910
cmpq %r8, %rdx
seta %cl
jmp 0x6934
xorl %ecx, %ecx
movzbl %cl, %eax
retq
xorl %r8d, %r8d
decq %rdx
movq %rdx, (%rdi)
movl %r8d, %esi
cmpq %rsi, %rdx
jbe 0x692d
movq 0x8(%rax,%r8,8), %rdx
movq %rdx, (%rax,%r8,8)
leaq 0x1(%r8), %rdx
movq %rdx, %r8
cmpq %rdx, (%rdi)
ja 0x6942
jmp 0x692d
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/darray.c
// Function: darray_remove_all
uint
darray_remove_all(darray_t* da, darray_t* from)
{
  size_t n_removed = 0;
  DARRAY_FOR_EACH(from, i)
    {
      uintptr_t elem = DARRAY_GET_N(from, i);
      n_removed += darray_remove(da, elem);
    }

  return n_removed;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, (%rsi)
je 0x6992
movq %rsi, %rbx
movq %rdi, %r15
xorl %r12d, %r12d
xorl %r14d, %r14d
movq 0x10(%rbx), %rax
movq (%rax,%r12,8), %rsi
movq %r15, %rdi
callq 0x68f5
movl %eax, %eax
addq %rax, %r14
incq %r12
cmpq %r12, (%rbx)
ja 0x6973
jmp 0x6995
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/darray.c
// Function: darray_exists_pos
inline int
darray_exists_pos(darray_t* da, uintptr_t elem, uint* pos)
{
  for (int i = 0; i < da->n_elems; i++)
    {
      if (unlikely(elem == da->array[i]))
	{
	  *pos = i;
	  return 1;
	}
    }
  return 0;
}

// Assembly:
movq (%rdi), %rcx
testq %rcx, %rcx
setne %al
je 0x69f3
movq 0x10(%rdi), %rdi
cmpq %rsi, (%rdi)
je 0x69f7
leaq -0x1(%rcx), %rax
xorl %r9d, %r9d
cmpq %r9, %rax
je 0x69f1
leaq 0x1(%r9), %r8
cmpq %rsi, 0x8(%rdi,%r9,8)
movq %r8, %r9
jne 0x69d6
cmpq %r8, %rcx
seta %al
jmp 0x69fa
xorl %eax, %eax
movzbl %al, %eax
retq
xorl %r8d, %r8d
movl %r8d, (%rdx)
jmp 0x69f3
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_infer_clustering
cdf_cluster_t*
mctop_infer_clustering(uint64_t** lat_table_norm, const size_t N)
{
  darray_t* clusters = darray_create();
  for (int x = 0; x < N; x++)
    {
      for (int y = 0; y < N; y++)
	{
	  darray_add_uniq(clusters, lat_table_norm[x][y]);
	}
    }

  int n_clusters = darray_get_num_elems(clusters);
  darray_sort(clusters);
  //printf("## Detected %2d clusters: ", n_clusters);
  /* darray_print(clusters); */

  cdf_cluster_t* cc = cdf_cluster_create_empty(n_clusters);
  cc->n_clusters = n_clusters;
  for (int c = 0; c < n_clusters; c++)
    {
      cc->clusters[c].idx = c;
      cc->clusters[c].median = darray_get_elem_n(clusters, c);
    }

  darray_free(clusters);
  return cc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
callq 0x66e4
movq %rax, %rbx
testq %r14, %r14
je 0x7039
xorl %r12d, %r12d
xorl %r13d, %r13d
movq (%r15,%r12,8), %rax
movq (%rax,%r13,8), %rsi
movq %rbx, %rdi
callq 0x27c3
incq %r13
cmpq %r13, %r14
jne 0x7019
incq %r12
cmpq %r14, %r12
jne 0x7016
movq %rbx, %rdi
callq 0x69ff
movq %rax, %r14
movq %rbx, %rdi
callq 0x6a31
movl %r14d, %edi
callq 0x659d
movq %rax, %r15
movslq %r14d, %rax
movq %rax, (%r15)
testl %eax, %eax
jle 0x7096
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x8(%r15), %rax
movl %r12d, (%rax,%r13)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6a03
movq 0x8(%r15), %rcx
movq %rax, 0x20(%rcx,%r13)
incq %r12
addq $0x28, %r13
cmpq %r12, %r14
jne 0x706e
movq %rbx, %rdi
callq 0x679b
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_create
mctop_t*
mctop_create(uint n_sockets, cdf_cluster_t* cc, uint n_hwcs, const int is_smt)
{
  mctop_t* topo = calloc_assert(1, sizeof(mctop_t));
  topo->is_smt = is_smt;
  topo->has_mem = NO_MEMORY;

  topo->n_sockets = n_sockets;
  topo->sockets = calloc_assert(topo->n_sockets, sizeof(socket_t));

  topo->n_levels = cc->n_clusters;
  topo->latencies = malloc_assert(topo->n_levels * sizeof(uint));
  for (int i = 0; i < topo->n_levels; i++)
    {
      topo->latencies[i] = cc->clusters[i].median;
    }

  topo->n_hwcs = n_hwcs;
  topo->hwcs = calloc_assert(topo->n_hwcs, sizeof(hw_context_t));
  for (int i = 0; i < topo->n_hwcs; i++)
    {
      topo->hwcs[i].id = i;
      topo->hwcs[i].phy_id = i;
      topo->hwcs[i].level = 0;      
      topo->hwcs[i].type = is_smt ? HW_CONTEXT : CORE;
    }
  
  return topo;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movl %edi, %r12d
movl $0x1, %edi
movl $0x88, %esi
callq 0x2150
testq %rax, %rax
je 0x7199
movq %rax, %rbx
movl %ebp, 0x28(%rax)
movl $0x0, 0x30(%rax)
movl %r12d, 0x18(%rax)
movl %r12d, %edi
movl $0xa8, %esi
callq 0x2150
testq %rax, %rax
je 0x7199
movq %rax, 0x20(%rbx)
movq (%r15), %r12
movl %r12d, (%rbx)
movl %r12d, %edi
shlq $0x2, %rdi
callq 0x21d0
testq %rax, %rax
je 0x71b8
movq %rax, 0x8(%rbx)
testl %r12d, %r12d
je 0x7143
movq 0x8(%r15), %rcx
movl %r12d, %edx
addq $0x20, %rcx
xorl %esi, %esi
movl (%rcx), %edi
movl %edi, (%rax,%rsi,4)
incq %rsi
addq $0x28, %rcx
cmpq %rsi, %rdx
jne 0x7132
movl %r14d, 0x10(%rbx)
movl %r14d, %r15d
movl $0x30, %esi
movq %r15, %rdi
callq 0x2150
testq %rax, %rax
je 0x7199
movq %rax, 0x40(%rbx)
testl %r14d, %r14d
je 0x718d
xorl %ecx, %ecx
testl %ebp, %ebp
sete %cl
addq $0xc, %rax
xorl %edx, %edx
movl %edx, -0xc(%rax)
movl %edx, (%rax)
movl $0x0, -0x8(%rax)
movl %ecx, -0x4(%rax)
incq %rdx
addq $0x30, %rax
cmpq %rdx, %r15
jne 0x7172
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x61a8(%rip), %rdi      # 0xd348
leaq 0x4958(%rip), %rsi      # 0xbaff
leaq 0x4986(%rip), %rcx      # 0xbb34
movl $0x69, %edx
callq 0x2110
leaq 0x6189(%rip), %rdi      # 0xd348
leaq 0x4939(%rip), %rsi      # 0xbaff
leaq 0x494b(%rip), %rcx      # 0xbb18
movl $0x59, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_hwc_group_create
hwc_group_t*
mctop_hwc_group_create(mctop_t* topo, uint n_hwcs, darray_t* hwc_ids, uint seq_id, uint lvl, uint lat, const int has_smt)
{
  hwc_group_t* group = calloc_assert(1, sizeof(hwc_group_t));
  group->id = mctop_create_id(seq_id, lvl);
  group->level = lvl;
  group->type = (has_smt && lvl == 1) ? CORE : HWC_GROUP;
  group->latency = lat;
  group->n_hwcs = n_hwcs;
  group->hwcs = (hw_context_t**) malloc_assert(group->n_hwcs * sizeof(hw_context_t*));
  group->topo = topo;

  darray_iter_t iter;
  darray_iter_init(&iter, hwc_ids);
  size_t elem, i = 0;
  while (darray_iter_next(&iter, &elem))
    {
      hw_context_t* hwc = mctop_get_hwc_n(topo, elem);
      group->hwcs[i++] = hwc;
      if (hwc->parent == NULL)
	{
	  hwc->parent = group;
	}
      else
	{
	  hwc_group_t* cur = hwc->parent;
	  while (cur->parent != NULL)
	    {
	      cur = cur->parent;
	    }
	  if (cur != group)
	    {
	      cur->parent = group;
	    }
	}
    }

  return group;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebp
movl %r8d, %r13d
movl %ecx, %r15d
movq %rdx, 0x10(%rsp)
movl %esi, %r12d
movq %rdi, %rbx
movl $0x1, %edi
movl $0xa8, %esi
callq 0x2150
testq %rax, %rax
je 0x7305
movq %rax, %r14
movl 0x60(%rsp), %eax
imull $0x2710, %r13d, %ecx    # imm = 0x2710
addl %r15d, %ecx
movl %ecx, (%r14)
movl %r13d, 0x4(%r14)
testl %eax, %eax
setne %al
cmpl $0x1, %r13d
sete %cl
andb %al, %cl
movzbl %cl, %eax
movl $0x2, %ecx
subl %eax, %ecx
movl %ecx, 0x8(%r14)
movl %ebp, 0xc(%r14)
movl %r12d, 0x28(%r14)
movl %r12d, %edi
shlq $0x3, %rdi
callq 0x21d0
testq %rax, %rax
je 0x7324
movq %rax, 0x30(%r14)
movq %rbx, 0x48(%r14)
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x6a76
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x6a82
testl %eax, %eax
je 0x72f3
xorl %r13d, %r13d
leaq 0x18(%rsp), %r15
leaq 0x8(%rsp), %r12
movl 0x8(%rsp), %ecx
movq 0x40(%rbx), %rax
leaq (%rcx,%rcx,2), %rdx
shlq $0x4, %rdx
leaq (%rax,%rdx), %rcx
movq 0x30(%r14), %rsi
movq %rcx, (%rsi,%r13,8)
movq 0x18(%rax,%rdx), %rcx
testq %rcx, %rcx
je 0x72d7
movq %rcx, %rax
movq 0x18(%rcx), %rcx
testq %rcx, %rcx
jne 0x72c0
cmpq %r14, %rax
je 0x72e1
addq $0x18, %rax
jmp 0x72de
addq %rdx, %rax
addq $0x18, %rax
movq %r14, (%rax)
incq %r13
movq %r15, %rdi
movq %r12, %rsi
callq 0x6a82
testl %eax, %eax
jne 0x729a
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x603c(%rip), %rdi      # 0xd348
leaq 0x47ec(%rip), %rsi      # 0xbaff
leaq 0x481a(%rip), %rcx      # 0xbb34
movl $0x69, %edx
callq 0x2110
leaq 0x601d(%rip), %rdi      # 0xd348
leaq 0x47cd(%rip), %rsi      # 0xbaff
leaq 0x47df(%rip), %rcx      # 0xbb18
movl $0x59, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_socket_create
socket_t*
mctop_socket_create(mctop_t* topo, 
		    uint n_hwcs, 
		    darray_t* hwc_ids, 
		    uint seq_id,
		    uint lvl, 
		    uint latency, 
		    uint64_t** mem_lat_table, 
		    const int is_smt)
{
  socket_t* socket = topo->sockets + seq_id;
  socket->id = mctop_create_id(seq_id, lvl);
  socket->level = lvl;
  socket->type = SOCKET;
  socket->latency = latency;
  socket->n_hwcs = n_hwcs;
  socket->hwcs = (hw_context_t**) malloc_assert(socket->n_hwcs * sizeof(hw_context_t*));
  socket->n_nodes = topo->n_sockets;
  socket->topo = topo;

  /* uint hwc_seq_id = seq_id * socket->n_hwcs; */

  darray_iter_t iter;
  darray_iter_init(&iter, hwc_ids);

  darray_t* pgroups = darray_create();
  size_t elem, i = 0;
  while (darray_iter_next(&iter, &elem))
    {
      hw_context_t* hwc = mctop_get_hwc_n(topo, elem);
      /* hwc->id = hwc_seq_id++; */
      socket->hwcs[i++] = hwc;
      hwc->socket = socket;

      hwc_group_t* cur = hwc->parent;
      while (cur && cur->parent != NULL && cur->parent != socket)
	{
	  cur = cur->parent;
	}
      if (cur != NULL)
	{
	  cur->parent = socket;
	  darray_add_uniq(pgroups, (uintptr_t) cur);
	}
      else
	{
	  hwc->parent = socket;
	}
    }
  darray_free(pgroups);


  return socket;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rdi, %r14
movq 0x20(%rdi), %rbx
movl %ecx, %eax
imulq $0xa8, %rax, %r12
imull $0x2710, %r8d, %eax     # imm = 0x2710
addl %ecx, %eax
movl %eax, (%rbx,%r12)
movl %r8d, 0x4(%rbx,%r12)
movl $0x3, 0x8(%rbx,%r12)
movl %r9d, 0xc(%rbx,%r12)
movl %esi, 0x28(%rbx,%r12)
movl %esi, %edi
shlq $0x3, %rdi
callq 0x21d0
testq %rax, %rax
je 0x745b
addq %r12, %rbx
movq %rax, 0x30(%rbx)
movl 0x18(%r14), %eax
movl %eax, 0x70(%rbx)
movq %r14, 0x48(%rbx)
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x6a76
xorl %eax, %eax
callq 0x66e4
movq %rax, %r15
movq %rsp, %rsi
movq %r12, %rdi
callq 0x6a82
testl %eax, %eax
je 0x7441
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
movq %rsp, %r13
movl (%rsp), %eax
movq 0x40(%r14), %rcx
leaq (%rax,%rax,2), %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq 0x30(%rbx), %rsi
movq %rax, (%rsi,%rbp,8)
incq %rbp
movq %rbx, 0x10(%rcx,%rdx)
movq 0x18(%rcx,%rdx), %rcx
testq %rcx, %rcx
je 0x742e
movq %rcx, %rsi
movq 0x18(%rcx), %rcx
testq %rcx, %rcx
je 0x7420
cmpq %rbx, %rcx
jne 0x740a
movq %rbx, 0x18(%rsi)
movq %r15, %rdi
callq 0x27c3
jmp 0x7432
movq %rbx, 0x18(%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x6a82
testl %eax, %eax
jne 0x73e2
movq %r15, %rdi
callq 0x679b
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5ee6(%rip), %rdi      # 0xd348
leaq 0x4696(%rip), %rsi      # 0xbaff
leaq 0x46a8(%rip), %rcx      # 0xbb18
movl $0x59, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_siblings_create
void
mctop_siblings_create(mctop_t* topo, uint socket_x_id, uint socket_y_id, uint* seq_id, uint lvl, uint latency)
{
  socket_t* socket_x = mctop_get_socket(topo, socket_x_id);
  socket_t* socket_y = mctop_get_socket(topo, socket_y_id);

  socket_x->siblings = realloc_assert(socket_x->siblings, (socket_x->n_siblings + 1) * sizeof(sibling_t*));
  socket_y->siblings = realloc_assert(socket_y->siblings, (socket_y->n_siblings + 1) * sizeof(sibling_t*));

  sibling_t* sibling = mctop_sibling_create((*seq_id)++, lvl, latency, socket_x, socket_y);
  socket_x->siblings[socket_x->n_siblings++] = sibling;
  socket_y->siblings[socket_y->n_siblings++] = sibling;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movl %r8d, %r15d
movq %rcx, %r12
movl %edx, %ebx
movq %rdi, %r13
callq 0x8c08
movq %rax, %r14
movq %r13, %rdi
movl %ebx, %esi
callq 0x8c08
movq %rax, %rbx
movq 0x58(%r14), %rdi
movl 0x50(%r14), %esi
incl %esi
shlq $0x3, %rsi
callq 0x2210
testq %rax, %rax
je 0x752d
movq %rax, 0x58(%r14)
movq 0x58(%rbx), %rdi
movl 0x50(%rbx), %esi
incl %esi
shlq $0x3, %rsi
callq 0x2210
testq %rax, %rax
je 0x752d
movq %rax, 0x58(%rbx)
movl (%r12), %edi
leal 0x1(%rdi), %eax
movl %eax, (%r12)
movl %r15d, %esi
movl %ebp, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x84c9
movq 0x58(%r14), %rcx
movl 0x50(%r14), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x50(%r14)
movq %rax, (%rcx,%rdx,8)
movq 0x58(%rbx), %rcx
movl 0x50(%rbx), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x50(%rbx)
movq %rax, (%rcx,%rdx,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5e14(%rip), %rdi      # 0xd348
leaq 0x45c4(%rip), %rsi      # 0xbaff
leaq 0x558d(%rip), %rcx      # 0xcacf
movl $0x61, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_fix_n_hwcs_per_core_smt
void
mctop_fix_n_hwcs_per_core_smt(mctop_t* topo)
{
  if (topo->is_smt)
    {
      hwc_group_t* gs = mctop_get_first_gs_at_lvl(topo, 1);
      assert(gs->type == CORE);
      topo->n_hwcs_per_core = gs->n_children;
    }
  else
    {
      topo->n_hwcs_per_core = 1;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x28(%rdi)
je 0x79e9
movq %rbx, %rdi
movl $0x1, %esi
callq 0x8c32
cmpl $0x1, 0x8(%rax)
jne 0x79f3
movl 0x3c(%rax), %eax
jmp 0x79ee
movl $0x1, %eax
movl %eax, 0x2c(%rbx)
popq %rbx
retq
leaq 0x53f3(%rip), %rdi      # 0xcded
leaq 0x53fd(%rip), %rsi      # 0xcdfe
leaq 0x540b(%rip), %rcx      # 0xce13
movl $0x353, %edx            # imm = 0x353
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_sibling_create
sibling_t*
mctop_sibling_create(uint seq_id, uint lvl, uint latency, socket_t* left, socket_t* right)
{
  sibling_t* sibling = calloc_assert(1, sizeof(sibling_t));
  sibling->id = mctop_create_id(seq_id, lvl);
  sibling->level = lvl;
  sibling->latency = latency;
  sibling->left = left;
  sibling->right = right;
  return sibling;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movl %esi, %r15d
movl %edi, %r12d
movl $0x1, %edi
movl $0x28, %esi
callq 0x2150
testq %rax, %rax
je 0x8517
imull $0x2710, %r15d, %ecx    # imm = 0x2710
addl %r12d, %ecx
movl %ecx, (%rax)
movl %r15d, 0x4(%rax)
movl %ebp, 0x8(%rax)
movq %r14, 0x10(%rax)
movq %rbx, 0x18(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4e2a(%rip), %rdi      # 0xd348
leaq 0x35da(%rip), %rsi      # 0xbaff
leaq 0x3608(%rip), %rcx      # 0xbb34
movl $0x69, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_cache_info_create
mctop_cache_info_t*
mctop_cache_info_create(const uint n_levels)
{
  mctop_cache_info_t* mci = malloc_assert(sizeof(mctop_cache_info_t));
  mci->n_levels = n_levels;
  mci->latencies = calloc_assert(n_levels, sizeof(uint64_t));
  mci->sizes_OS = calloc_assert(n_levels, sizeof(uint64_t));
  mci->sizes_estimated = calloc_assert(n_levels, sizeof(uint64_t));
  return mci;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebp
movl $0x20, %edi
callq 0x21d0
testq %rax, %rax
je 0x85bc
movq %rax, %rbx
movl %ebp, (%rax)
movl %ebp, %r14d
movl $0x8, %esi
movq %r14, %rdi
callq 0x2150
testq %rax, %rax
je 0x859d
movq %rax, 0x8(%rbx)
movl $0x8, %esi
movq %r14, %rdi
callq 0x2150
testq %rax, %rax
je 0x859d
movq %rax, 0x10(%rbx)
movl $0x8, %esi
movq %r14, %rdi
callq 0x2150
testq %rax, %rax
je 0x859d
movq %rax, 0x18(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x4da4(%rip), %rdi      # 0xd348
leaq 0x3554(%rip), %rsi      # 0xbaff
leaq 0x3582(%rip), %rcx      # 0xbb34
movl $0x69, %edx
callq 0x2110
leaq 0x4d85(%rip), %rdi      # 0xd348
leaq 0x3535(%rip), %rsi      # 0xbaff
leaq 0x3547(%rip), %rcx      # 0xbb18
movl $0x59, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_cache_info_free
void
mctop_cache_info_free(mctop_cache_info_t* mci)
{
  free(mci->latencies);
  free(mci->sizes_OS);
  free(mci->sizes_estimated);
  free(mci);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2030
movq 0x10(%rbx), %rdi
callq 0x2030
movq 0x18(%rbx), %rdi
callq 0x2030
movq %rbx, %rdi
popq %rbx
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_power_measurements_create
double***
mctop_power_measurements_create(const uint n_sockets)
{
  double*** pow_measurements = malloc_assert(MCTOP_POW_TYPE_NUM * sizeof(double**));
  for (uint i = 0; i < MCTOP_POW_TYPE_NUM; i++)
    {
      pow_measurements[i] = malloc_assert((n_sockets + 1) * sizeof(double*));
      for (uint s = 0; s <= n_sockets; s++)
	{
	  pow_measurements[i][s] = malloc_assert(MCTOP_POW_COMP_TYPE_NUM * sizeof(double));
	}
    }
  return pow_measurements;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movl $0x30, %edi
callq 0x21d0
testq %rax, %rax
je 0x8a2d
movq %rax, %r14
leal 0x1(%rbx), %r15d
shlq $0x3, %r15
xorl %r13d, %r13d
movq %r15, %rdi
callq 0x21d0
testq %rax, %rax
je 0x8a2d
movq %rax, %r12
movq %rax, (%r14,%r13,8)
xorl %ebp, %ebp
movl $0x28, %edi
callq 0x21d0
testq %rax, %rax
je 0x8a2d
movl %ebp, %ecx
movq %rax, (%r12,%rcx,8)
incl %ebp
cmpl %ebx, %ebp
jbe 0x89f7
incq %r13
cmpq $0x6, %r13
jne 0x89e1
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4914(%rip), %rdi      # 0xd348
leaq 0x30c4(%rip), %rsi      # 0xbaff
leaq 0x30d6(%rip), %rcx      # 0xbb18
movl $0x59, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_power_measurements_free
void
mctop_power_measurements_free(double*** m, const uint n_sockets)
{
  for (uint i = 0; i < MCTOP_POW_TYPE_NUM; i++)
    {
      for (uint s = 0; s <= n_sockets; s++)
	{
	  free(m[i][s]);
	}
      free(m[i]);
    }
  free(m);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%rbx,%r14,8), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2030
incl %r15d
cmpl %ebp, %r15d
jbe 0x8a5e
movq (%rbx,%r14,8), %rdi
callq 0x2030
incq %r14
cmpq $0x6, %r14
jne 0x8a5b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_topology.c
// Function: mctop_pow_info_add
void
mctop_pow_info_add(mctop_t* topo, double*** pm)
{
  for (int i = 0; i <= topo->n_sockets; i++)
    {
      mctop_pow_info_t* pi = malloc_assert(sizeof(mctop_pow_info_t));
      uint div = 1;
      if (i < topo->n_sockets)
	{
	  topo->sockets[i].pow_info = pi;
	}
      else
	{
	  topo->pow_info = pi;
	  div = topo->n_sockets;
	}
      uint type = 0;
      __copy_doubles(pi->idle, pm[type++][i], MCTOP_POW_COMP_TYPE_NUM, 1);
      __copy_doubles(pi->first_core, pm[type++][i], MCTOP_POW_COMP_TYPE_NUM, div);
      __copy_doubles(pi->second_core, pm[type++][i], MCTOP_POW_COMP_TYPE_NUM, div);
      __copy_doubles(pi->second_hwc_core, pm[type++][i], MCTOP_POW_COMP_TYPE_NUM, div);
      __copy_doubles(pi->all_cores, pm[type++][i], MCTOP_POW_COMP_TYPE_NUM, 1);
      __copy_doubles(pi->all_hwcs, pm[type++][i], MCTOP_POW_COMP_TYPE_NUM, 1);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x18(%rdi), %r15d
cvtsi2sd %r15, %xmm0
movsd %xmm0, (%rsp)
leaq 0x80(%rdi), %r12
leal 0x1(%r15), %r13d
xorl %ebp, %ebp
movl $0x120, %edi            # imm = 0x120
callq 0x21d0
testq %rax, %rax
je 0x8be8
movq %r12, %rcx
movsd (%rsp), %xmm0
cmpq %r15, %rbp
jae 0x8b03
movq 0x20(%r14), %rcx
imulq $0xa8, %rbp, %rdx
addq %rdx, %rcx
addq $0xa0, %rcx
movsd 0x3cb5(%rip), %xmm0     # 0xc7b8
movq %rax, (%rcx)
movq (%rbx), %rcx
movq (%rcx,%rbp,8), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm1
movsd %xmm1, (%rax,%rdx,8)
incq %rdx
cmpq $0x5, %rdx
jne 0x8b0f
movq 0x8(%rbx), %rcx
movq (%rcx,%rbp,8), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rax,%rdx,8)
incq %rdx
cmpq $0x5, %rdx
jne 0x8b2c
movq 0x10(%rbx), %rcx
movq (%rcx,%rbp,8), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x60(%rax,%rdx,8)
incq %rdx
cmpq $0x5, %rdx
jne 0x8b4e
movq 0x18(%rbx), %rcx
movq (%rcx,%rbp,8), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x90(%rax,%rdx,8)
incq %rdx
cmpq $0x5, %rdx
jne 0x8b70
movq 0x20(%rbx), %rcx
movq (%rcx,%rbp,8), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, 0xc0(%rax,%rdx,8)
incq %rdx
cmpq $0x5, %rdx
jne 0x8b95
movq 0x28(%rbx), %rcx
movq (%rcx,%rbp,8), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, 0xf0(%rax,%rdx,8)
incq %rdx
cmpq $0x5, %rdx
jne 0x8bb6
incq %rbp
cmpq %r13, %rbp
jne 0x8ac6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4759(%rip), %rdi      # 0xd348
leaq 0x2f09(%rip), %rsi      # 0xbaff
leaq 0x2f1b(%rip), %rcx      # 0xbb18
movl $0x59, %edx
callq 0x2110
nop
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_get_first_gs_at_lvl
inline hwc_gs_t*
mctop_get_first_gs_at_lvl(mctop_t* topo, const uint lvl)
{
  hwc_gs_t* cur = mctop_get_first_socket(topo);
  while (cur != NULL && cur->level != lvl)
    {
      cur = cur->children[0];
    }
  return cur;
}

// Assembly:
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x8c49
cmpl %esi, 0x4(%rax)
je 0x8c49
movq 0x40(%rax), %rax
movq (%rax), %rax
jmp 0x8c36
retq
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_get_sibling_with_sockets
sibling_t*
mctop_get_sibling_with_sockets(mctop_t* topo, socket_t* s0, socket_t* s1)
{
  for (int i = 0; i < topo->n_siblings; i++)
    {
      sibling_t* sibling = topo->siblings[i];
      if (mctop_sibling_contains_sockets(sibling, s0, s1))
	{
	  return sibling;
	}
    }

  return NULL;
}

// Assembly:
movl 0x48(%rdi), %ecx
testq %rcx, %rcx
je 0x8cd6
movq 0x50(%rdi), %rdi
xorl %r8d, %r8d
movq (%rdi,%r8,8), %r9
movq 0x10(%r9), %r10
cmpq %rsi, %r10
jne 0x8cb2
cmpq %rdx, 0x18(%r9)
je 0x8cc2
cmpq %rdx, %r10
jne 0x8cbd
cmpq %rsi, 0x18(%r9)
je 0x8cc2
movb $0x1, %r10b
jmp 0x8cc5
xorl %r10d, %r10d
testb %r10b, %r10b
cmoveq %r9, %rax
je 0x8cd8
incq %r8
cmpq %r8, %rcx
jne 0x8c9f
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_get_cache_size_kb
size_t
mctop_get_cache_size_kb(mctop_t* topo, mctop_cache_level_t level)
{
  mctop_cache_info_t* mci = topo->cache;
  if (mci)
    {
      return mci->sizes_OS[level] ? mci->sizes_OS[level] : mci->sizes_estimated[level];
    }
  return 0;
}

// Assembly:
movq 0x58(%rdi), %rcx
testq %rcx, %rcx
je 0x8d15
movq 0x10(%rcx), %rax
movl %esi, %edx
movq (%rax,%rdx,8), %rax
testq %rax, %rax
je 0x8d18
retq
xorl %eax, %eax
retq
movq 0x18(%rcx), %rax
movq (%rax,%rdx,8), %rax
retq
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_socket_get_nth_gs_core
hwc_gs_t*
mctop_socket_get_nth_gs_core(socket_t* socket, const uint nth)
{
  hwc_gs_t* gs = socket->children[0];
  while (gs && gs->type != CORE)
    {
      gs = gs->children[0];
    }
  for (int i = 0; i < nth; i++)
    {
      gs = gs->next;
    }
  return gs;
}

// Assembly:
movq %rdi, %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x8d8d
cmpl $0x1, 0x8(%rax)
jne 0x8d7b
testl %esi, %esi
je 0x8d99
movq 0x20(%rax), %rax
decl %esi
jne 0x8d91
retq
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_hwcid_fix_numa_node
int
mctop_hwcid_fix_numa_node(mctop_t* topo, const uint hwcid)
{
#ifdef __x86_64__
  /* printf("# HWID %-3u, SOCKET %-3u, numa_set_preferred(%u)\n", */
  /* 	     hwcid, hwc->socket->id, hwc->socket->local_node); */
  hw_context_t* hwc = &topo->hwcs[hwcid];
  const uint correct_node = hwc->socket->local_node;
  if (unlikely(hwc->local_node_wrong || correct_node != numa_preferred()))
    {
      numa_set_preferred(correct_node);
      return 1;
    }
#endif
  return 0;
}

// Assembly:
pushq %rbx
movq 0x40(%rdi), %rax
movl %esi, %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq 0x10(%rax,%rcx), %rdx
movl 0x6c(%rdx), %ebx
cmpl $0x0, 0x28(%rax,%rcx)
jne 0x8e27
callq 0x22e0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %ebx
jne 0x8e27
popq %rbx
retq
movl %ebx, %edi
callq 0x22a0
movl $0x1, %eax
jmp 0x8e25
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_hwcid_get_nth_hwc_in_socket
uint
mctop_hwcid_get_nth_hwc_in_socket(mctop_t* topo, const uint hwcid)
{
  socket_t* socket = mctop_hwcid_get_socket(topo, hwcid);
  hw_context_t* hwc_first = mctop_socket_get_first_hwc(socket);
  uint i = 0;
  while (hwc_first && hwc_first->id != hwcid)
    {
      i++;
      hwc_first = hwc_first->next;
    }

  return i;
}

// Assembly:
movq 0x40(%rdi), %rax
movl %esi, %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq 0x10(%rax,%rcx), %rax
movq 0x30(%rax), %rax
movq (%rax), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x8eab
cmpl %esi, (%rcx)
je 0x8eab
incl %eax
movq 0x20(%rcx), %rcx
jmp 0x8e9a
retq
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_hwcid_get_nth_hwc_in_core
uint
mctop_hwcid_get_nth_hwc_in_core(mctop_t* topo, const uint hwcid)
{
  hw_context_t* hwc = &topo->hwcs[hwcid];
  if (hwc->type == CORE)
    {
      return 0;
    }
  hwc_gs_t* core = hwc->parent;
  for (int i = 0; i < core->n_hwcs; i++)
    {
      if (core->hwcs[i]->id == hwc->id)
	{
	  return i;
	}
    }
  assert(0);
}

// Assembly:
pushq %rax
movq 0x40(%rdi), %rdx
movl %esi, %eax
leaq (%rax,%rax,2), %rcx
shlq $0x4, %rcx
xorl %eax, %eax
cmpl $0x1, 0x8(%rdx,%rcx)
jne 0x8ec6
popq %rcx
retq
addq %rcx, %rdx
movq 0x18(%rdx), %rax
movl 0x28(%rax), %ecx
testq %rcx, %rcx
je 0x8eed
movq 0x30(%rax), %rsi
movl (%rdx), %edx
xorl %eax, %eax
movq (%rsi,%rax,8), %rdi
cmpl %edx, (%rdi)
je 0x8ec4
incq %rax
cmpq %rax, %rcx
jne 0x8edd
leaq 0x2c09(%rip), %rdi      # 0xbafd
leaq 0x4048(%rip), %rsi      # 0xcf43
leaq 0x4055(%rip), %rcx      # 0xcf57
movl $0x158, %edx            # imm = 0x158
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_hwcid_get_nth_core_in_socket
uint
mctop_hwcid_get_nth_core_in_socket(mctop_t* topo, const uint hwcid)
{
  hwc_gs_t* core = mctop_hwcid_get_core(topo, hwcid);
  hwc_gs_t* core_first = mctop_socket_get_first_gs_core(core->socket);
  uint i = 0;
  while (core_first && core->id != core_first->id)
    {
      i++;
      core_first = core_first->next;
    }

  return i;
}

// Assembly:
movq 0x40(%rdi), %rcx
movl %esi, %eax
leaq (%rax,%rax,2), %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
cmpl $0x1, 0x8(%rcx,%rdx)
je 0x8f29
movq 0x18(%rax), %rax
movq 0x10(%rax), %rcx
movq 0x40(%rcx), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x8f53
cmpl $0x1, 0x8(%rcx)
jne 0x8f2d
movl (%rax), %edx
xorl %eax, %eax
cmpl (%rcx), %edx
je 0x8f52
incl %eax
movq 0x20(%rcx), %rcx
testq %rcx, %rcx
jne 0x8f43
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_run_on_socket_ref
int
mctop_run_on_socket_ref(socket_t* socket, const uint fix_mem)
{
  int ret = 0;
  if (socket == NULL)
    {
      return -EINVAL;
    }

#ifdef __x86_64__
  struct bitmask* bmask = numa_bitmask_alloc(socket->topo->n_hwcs);
  for (int i = 0; i < socket->n_hwcs; i++) 
    {
      bmask = numa_bitmask_setbit(bmask, socket->hwcs[i]->id);
    }

  ret = numa_sched_setaffinity(0, bmask);
  if (fix_mem && !ret && socket->topo->has_mem)
    {
      numa_set_preferred(socket->local_node);
    }
  numa_bitmask_free(bmask);
#else
  ret = mctop_run_on_node(socket->topo, socket->local_node);
#endif
  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x9002
movl %esi, %ebp
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movl 0x10(%rax), %edi
callq 0x2200
movq %rax, %r14
cmpl $0x0, 0x28(%rbx)
je 0x8fd0
xorl %r15d, %r15d
movq 0x30(%rbx), %rax
movq (%rax,%r15,8), %rax
movl (%rax), %esi
movq %r14, %rdi
callq 0x21a0
movq %rax, %r14
incq %r15
movl 0x28(%rbx), %eax
cmpq %rax, %r15
jb 0x8fb0
xorl %edi, %edi
movq %r14, %rsi
callq 0x2180
movl %eax, %r15d
testl %ebp, %ebp
je 0x8ff8
testl %r15d, %r15d
jne 0x8ff8
movq 0x48(%rbx), %rax
cmpl $0x0, 0x30(%rax)
je 0x8ff8
movl 0x6c(%rbx), %edi
callq 0x22a0
movq %r14, %rdi
callq 0x2330
jmp 0x9008
movl $0xffffffea, %r15d      # imm = 0xFFFFFFEA
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_aux.c
// Function: table_malloc
void**
table_malloc(const size_t rows, const size_t cols, const size_t elem_size)
{
  void** m = malloc_assert(rows * sizeof(uint64_t*));
  for (int s = 0; s < rows; s++)
    {
      m[s] = malloc_assert(cols * elem_size);
    }

  return m;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
leaq (,%rdi,8), %rdi
callq 0x21d0
testq %rax, %rax
je 0x90de
movq %rax, %r15
testq %r14, %r14
je 0x90cf
imulq %r12, %rbx
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x21d0
testq %rax, %rax
je 0x90de
movq %rax, (%r15,%r12,8)
incq %r12
cmpq %r12, %r14
jne 0x90b6
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x4263(%rip), %rdi      # 0xd348
leaq 0x2a13(%rip), %rsi      # 0xbaff
leaq 0x2a25(%rip), %rcx      # 0xbb18
movl $0x59, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_aux.c
// Function: table_calloc
void**
table_calloc(const size_t rows, const size_t cols, const size_t elem_size)
{
  void** m = malloc_assert(rows * sizeof(uint64_t*));
  for (int s = 0; s < rows; s++)
    {
      m[s] = calloc_assert(cols, elem_size);
    }

  return m;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq (,%rdi,8), %rdi
callq 0x21d0
testq %rax, %rax
je 0x9174
movq %rax, %r12
testq %r15, %r15
je 0x9148
xorl %r13d, %r13d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2150
testq %rax, %rax
je 0x9155
movq %rax, (%r12,%r13,8)
incq %r13
cmpq %r13, %r15
jne 0x912c
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x41ec(%rip), %rdi      # 0xd348
leaq 0x299c(%rip), %rsi      # 0xbaff
leaq 0x29ca(%rip), %rcx      # 0xbb34
movl $0x69, %edx
callq 0x2110
leaq 0x41cd(%rip), %rdi      # 0xd348
leaq 0x297d(%rip), %rsi      # 0xbaff
leaq 0x298f(%rip), %rcx      # 0xbb18
movl $0x59, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_aux.c
// Function: table_free
void
table_free(void** m, const size_t cols)
{
  for (int s = 0; s < cols; s++)
    {
      free(m[s]);
    }
  free(m);
  m = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x91b7
movq %rsi, %r14
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdi
callq 0x2030
incq %r15
cmpq %r15, %r14
jne 0x91a6
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_load.c
// Function: mctop_load_mem_bw
static uint
mctop_load_mem_bw(FILE* ifile, const uint n_sockets, double** bw_table)
{
  for (uint x = 0; x < (n_sockets * n_sockets); x++)
    {
      uint xc, yc;
      double bw;
      if (fscanf(ifile, "%u %u %lf", &xc, &yc, &bw) != 3)
	{
	  return 0;
	}
      bw_table[xc][yc] = bw;
    }
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
imull %ebx, %ebx
testl %ebx, %ebx
sete %bpl
je 0x9bcd
movq %rdx, %r14
movq %rdi, %r15
leaq 0x365e(%rip), %rsi      # 0xd1b9
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x10(%rsp), %r8
xorl %eax, %eax
callq 0x2070
cmpl $0x3, %eax
jne 0x9bcd
leal -0x1(%rbx), %r13d
leaq 0x10(%rsp), %r12
xorl %ebp, %ebp
movsd 0x10(%rsp), %xmm0
movl 0xc(%rsp), %eax
movq (%r14,%rax,8), %rax
movl 0x8(%rsp), %ecx
movsd %xmm0, (%rax,%rcx,8)
cmpl %ebp, %r13d
je 0x9bca
movq %r15, %rdi
leaq 0x3612(%rip), %rsi      # 0xd1b9
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x2070
incl %ebp
cmpl $0x3, %eax
je 0x9b81
cmpl %ebx, %ebp
setae %bpl
jmp 0x9bcd
movb $0x1, %bpl
movzbl %bpl, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/LPD-EPFL[P]mctop/src/mctop_cache.c
// Function: array_get_min
ticks
array_get_min(ticks* a, const int len)
{
  ticks min = a[0];
  for (size_t i = 1; i < len; i++)
    {
      if (a[i] < min)
	{
	  min = a[i];
	}
    }

  return min;
}

// Assembly:
movq (%rdi), %rax
cmpl $0x2, %esi
jb 0xa059
movslq %esi, %rcx
movl $0x1, %edx
movq (%rdi,%rdx,8), %rsi
cmpq %rax, %rsi
cmovbq %rsi, %rax
incq %rdx
cmpq %rdx, %rcx
jne 0xa046
retq
nop
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_faidx.c
// Function: load_index
faidx_t * load_index(const char *fn, const char *fnfai, const char *fngzi,
                     int flags, enum fai_format_options format) {
    faidx_t *fai = fai_load3_format(fn, fnfai, fngzi, flags, format);
    if (!fai) {
        fprintf(stderr, "Failed: fai_load3(%s, %s, %s, %d, %d)\n",
                fn, fnfai ? fnfai : "NULL", fngzi ? fngzi : "NULL", flags,
                (int) format);
        return NULL;
    }
    return fai;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0x8423
movq %rax, %r13
testq %rax, %rax
je 0x60ab
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xacf26(%rip), %rax     # 0xb2fd8
testq %r15, %r15
leaq 0x8e335(%rip), %rcx     # 0x943f1
cmoveq %rcx, %r15
movq (%rax), %rdi
testq %r14, %r14
cmoveq %rcx, %r14
movl %ebp, (%rsp)
leaq 0x8bfae(%rip), %rsi     # 0x92082
xorl %r13d, %r13d
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movl %ebx, %r9d
xorl %eax, %eax
callq 0x4710
jmp 0x6099
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_faidx.c
// Function: test_fai_line_length
int test_fai_line_length(const char *fn, const char *fnfai, const char *fngzi,
                         enum fai_format_options format, const char *expected,
                         const char *reg) {
    hts_pos_t found_len;
    faidx_t *fai = NULL;

    fai = load_index(fn, fnfai, fngzi, 0, format);
    if (!fai)
        return -1;

    found_len = fai_line_length(fai, reg);
    fai_destroy(fai);
    if (expected) {
        long long exp_len = strtoll(expected, NULL, 10);
        if (found_len != exp_len) {
            fprintf(stderr, "Unexpected result %"PRIhts_pos" from "
                    "fai_line_length, expected %s\n", found_len, expected);
            return -1;
        }
    } else {
        printf("%"PRIhts_pos"\n", found_len);
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, %rbx
movl %ecx, %r8d
xorl %ecx, %ecx
callq 0x6073
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x6803
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x8439
movq %rax, %r14
movq %r12, %rdi
callq 0x6ef4
testq %rbx, %rbx
je 0x67ef
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x40b0
cmpq %rax, %r14
je 0x6803
movq 0xac808(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x8ba75(%rip), %rsi     # 0x9224f
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4710
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x6803
leaq 0x8b9f7(%rip), %rdi     # 0x921ed
xorl %r15d, %r15d
movq %r14, %rsi
xorl %eax, %eax
callq 0x4060
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_faidx.c
// Function: test_faidx_has_seq
int test_faidx_has_seq(const char *fn, const char *fnfai, const char *fngzi,
                       enum fai_format_options format, const char *expected,
                       const char *seq) {
    int res;
    faidx_t *fai = NULL;

    fai = load_index(fn, fnfai, fngzi, 0, format);
    if (!fai)
        return -1;

    res = faidx_has_seq(fai, seq);
    fai_destroy(fai);
    if (expected) {
        long exp_res = strtol(expected, NULL, 10);
        if (res != exp_res) {
            fprintf(stderr, "Unexpected result %d from faidx_has_seq(%s) "
                    "expected %s\n", res, seq, expected);
            return -1;
        }
    } else {
        printf("%d\n", res);
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %r14
movq %r8, %rbx
movl %ecx, %r8d
xorl %ecx, %ecx
callq 0x6073
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x68a7
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x8f4a
movl %eax, %ebp
movq %r12, %rdi
callq 0x6ef4
testq %rbx, %rbx
je 0x6894
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x46e0
movslq %ebp, %rcx
cmpq %rcx, %rax
je 0x68a7
movq 0xac765(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x8ba0b(%rip), %rsi     # 0x92288
movl %ebp, %edx
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x4710
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x68a7
leaq 0x91333(%rip), %rdi     # 0x97bce
xorl %r15d, %r15d
movl %ebp, %esi
xorl %eax, %eax
callq 0x4060
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq