LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/helper.c
// Function: spin_time
ticks
spin_time(size_t n)
{
  volatile ticks __s = getticks();
  volatile size_t sum = 0;
  for (volatile size_t i = 0; i < n; i++)
    {
      sum += i;
    }
  volatile ticks __e = getticks();
  return __e - __s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
callq 0x6f00
movq %rax, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x8(%rbp), %rax
jae 0x713c
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x7115
callq 0x6f00
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/include/helper.h
// Function: xorshf96
static inline unsigned long
xorshf96(unsigned long* x, unsigned long* y, unsigned long* z)  //period 2^96-1
{
  unsigned long t;
  (*x) ^= (*x) << 16;
  (*x) ^= (*x) >> 5;
  (*x) ^= (*x) << 1;

  t = *x;
  (*x) = *y;
  (*y) = *z;
  (*z) = t ^ (*x) ^ (*y);

  return *z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
shlq $0x10, %rcx
movq -0x8(%rbp), %rax
xorq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
shrq $0x5, %rcx
movq -0x8(%rbp), %rax
xorq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
shlq %rcx
movq -0x8(%rbp), %rax
xorq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
xorq (%rax), %rcx
movq -0x10(%rbp), %rax
xorq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
popq %rbp
retq
nop
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x80, %edi
callq 0x21a0
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x742f
jmp 0x744e
leaq 0x965b(%rip), %rdi      # 0x10a91
leaq 0x9656(%rip), %rsi      # 0x10a93
movl $0x7, %edx
leaq 0x9658(%rip), %rcx      # 0x10aa1
callq 0x20e0
movl $0x0, -0xc(%rbp)
movslq -0xc(%rbp), %rax
cmpq $0x10, %rax
jae 0x7489
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movl $0x0, 0x40(%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7455
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/barrier.c
// Function: barrier2_cross
inline void
barrier2_cross(barrier2_t* b, const int tid, const size_t round)
{
  COMPILER_BARRIER();
  MFENCE();
  int vn = round & (BARRIER2_NUM_BARRIER - 1);
  if (tid == 0)
    {
      DAF_U32(&b->val[vn]);
    }
  else				/* tid == 1 */
    {
      IAF_U32(&b->val[vn]);
    }

  COMPILER_BARRIER();
  while (b->val[vn] != 0)
    {
      PAUSE();
      MFENCE();
    }
  MFENCE();
  COMPILER_BARRIER();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
mfence
movq -0x18(%rbp), %rax
andq $0xf, %rax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x74d1
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
lock
decl (%rax,%rcx,4)
jmp 0x74dd
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
lock
incl (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl $0x0, %eax
je 0x74f4
pause
mfence
jmp 0x74dd
mfence
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/barrier.c
// Function: barrier2_cross_explicit
inline void
barrier2_cross_explicit(barrier2_t* b, const int tid, const size_t barrier_num)
{
  MFENCE();
  int vn = barrier_num;
  if (tid == 0)
    {
      DAF_U32(&b->eval[vn]);
    }
  else				/* tid == 1 */
    {
      IAF_U32(&b->eval[vn]);
    }

  COMPILER_BARRIER();
  while (b->eval[vn] != 0)
    {
      PAUSE();
      MFENCE();
    }
  MFENCE();
  COMPILER_BARRIER();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
mfence
movq -0x18(%rbp), %rax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x752e
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
lock
decl 0x40(%rax,%rcx,4)
jmp 0x753b
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
lock
incl 0x40(%rax,%rcx,4)
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0x40(%rax,%rcx,4), %eax
cmpl $0x0, %eax
je 0x7553
pause
mfence
jmp 0x753b
mfence
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/cdf.c
// Function: cdf_comp
static int
cdf_comp(const void* elem1, const void* elem2) 
{
  uint64_t f = *((uint64_t*) elem1);
  uint64_t s = *((uint64_t*) elem2);
  if (f > s)
    {
      return  1;
    }
  if (f < s)
    {
      return -1;
    }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jbe 0x7835
movl $0x1, -0x4(%rbp)
jmp 0x784f
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x7848
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x784f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movslq -0x14(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7e88
cmpq $0x0, -0x10(%rbp)
je 0x7e60
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
cmpq -0x10(%rbp), %rax
jae 0x7e7b
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x7e7d
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7e2f
movq -0x10(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x8c4b(%rip), %rdi      # 0x10b9e
movb $0x0, %al
callq 0x20d0
movl $0x0, -0xc(%rbp)
movslq -0xc(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7fff
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %esi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rdi
imulq $0x28, %rdi, %rdi
addq %rdi, %rax
movq 0x18(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rdi
imulq $0x28, %rdi, %rdi
addq %rdi, %rax
movq 0x20(%rax), %r9
leaq 0x8bf4(%rip), %rdi      # 0x10bde
movb $0x0, %al
callq 0x20d0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7f61
leaq 0x84c5(%rip), %rdi      # 0x104cb
movb $0x0, %al
callq 0x20d0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x80a8
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x10(%rcx), %rax
jb 0x809b
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x18(%rcx), %rax
ja 0x809b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x80cc
jmp 0x809d
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8037
movq 0xcf49(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x8b62(%rip), %rsi      # 0x10c1f
movb $0x0, %al
callq 0x2140
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x18, %edi
callq 0x8130
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq $0x8, 0x8(%rax)
movl $0x40, %edi
callq 0x8130
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x83cf
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
shlq $0x3, %rsi
callq 0x8300
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/darray.c
// Function: darray_add_uniq
int 
darray_add_uniq(darray_t* da, uintptr_t elem)
{
  if (darray_exists(da, elem))
    {
      return 0;
    }
  darray_add(da, elem);
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x8460
cmpl $0x0, %eax
je 0x843b
movl $0x0, -0x4(%rbp)
jmp 0x844f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x8260
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/darray.c
// Function: darray_exists
inline int			
darray_exists(darray_t* da, uintptr_t elem)
{
  for (int i = 0; i < da->n_elems; i++)
    {
      if (unlikely(elem == da->array[i]))
	{
	  return 1;
	}
    }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x84be
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x84b1
movl $0x1, -0x4(%rbp)
jmp 0x84c5
jmp 0x84b3
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8473
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/darray.c
// Function: darray_shift_right
static void
darray_shift_right(darray_t* da)
{
  DARRAY_RESIZE(da);
  if (da->n_elems++ == 0)
    {
      return;
    }

  for (int i = da->n_elems - 1; i > 0; i--)
    {
      da->array[i] = da->array[i - 1];
    }
  da->array[0] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x856a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
shlq $0x3, %rsi
callq 0x8300
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
cmpq $0x0, %rax
jne 0x8583
jmp 0x85d6
movq -0x8(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0x85c7
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8591
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq $0x0, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x8696
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x8686
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
movslq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x867d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x20(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x8640
movl $0x1, -0x4(%rbp)
jmp 0x869d
jmp 0x8688
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x85f3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x8712
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x85e0
cltq
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x86cf
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/darray.c
// Function: darray_pop
int
darray_pop(darray_t* da, uintptr_t* elem)
{
  if (unlikely(da->n_elems == 0))
    {
      return 0;
    }

  *elem = da->array[0];
  da->n_elems--;
  for (int i = 0; i < da->n_elems; i++)
    {
      da->array[i] = da->array[i + 1];
    }
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x8751
movl $0x0, -0x4(%rbp)
jmp 0x87bc
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x87b5
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8778
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x888b
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x24(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x887e
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x8892
jmp 0x8880
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x8837
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/darray.c
// Function: darray_swap_if_greater
static inline void
darray_swap_if_greater(size_t* arr, int a, int b)
{
  if (arr[a] > arr[b])
    {
      uintptr_t tmp = arr[a];
      arr[a] = arr[b];
      arr[b] = tmp;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rcx
movslq -0x10(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
jbe 0x89f0
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/darray.c
// Function: darray_iter_next
inline int			/* error or OK */
darray_iter_next(darray_iter_t* dai, uintptr_t* elem)
{
  if (dai->curr >= dai->darray->n_elems)
    {
      return 0;
    }
  *elem = dai->darray->array[dai->curr++];
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpq (%rcx), %rax
jb 0x8a59
movl $0x0, -0x4(%rbp)
jmp 0x8a89
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
movq (%rax,%rcx,8), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, %al
callq 0x80e0
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x91b2
movl $0x0, -0x20(%rbp)
movslq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x91a5
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x8410
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x9173
jmp 0x91a7
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x9162
movq -0x18(%rbp), %rdi
callq 0x88a0
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8920
movl -0x24(%rbp), %edi
callq 0x7e90
movq %rax, -0x30(%rbp)
movslq -0x24(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x9237
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x88c0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x20(%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x91e5
movq -0x18(%rbp), %rdi
callq 0x8210
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movl $0x1, %edi
movl $0xa8, %esi
callq 0xaf30
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %edi
movl -0x20(%rbp), %esi
callq 0xaf90
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x20(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
xorl %eax, %eax
cmpl $0x0, 0x10(%rbp)
movb %al, -0x61(%rbp)
je 0x94a6
cmpl $0x1, -0x20(%rbp)
sete %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %dl
movl $0x2, %ecx
movl $0x1, %eax
testb $0x1, %dl
cmovnel %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0xc(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x30(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, %edi
shlq $0x3, %rdi
callq 0x93f0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x8a00
movq $0x0, -0x50(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x8a30
cmpl $0x0, %eax
je 0x95b5
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rax
movl %eax, %esi
callq 0xafb0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x50(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x50(%rbp)
movq %rdx, (%rax,%rcx,8)
movq -0x58(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x9573
movq -0x30(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x95b0
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x9598
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x957f
movq -0x60(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x95ae
movq -0x30(%rbp), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x95b0
jmp 0x9512
movq -0x30(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xba60
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0xba60
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x50(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
shlq $0x3, %rsi
callq 0xb050
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x50(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
shlq $0x3, %rsi
callq 0xb050
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %edi
movl %edi, %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0xafd0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdx
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x28(%rbp), %rsi
movl 0x50(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x50(%rsi)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x30(%rbp), %rsi
movl 0x50(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x50(%rsi)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0xa003
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xbb10
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x9fd4
jmp 0x9ff3
leaq 0x70bd(%rip), %rdi      # 0x11098
leaq 0x70c7(%rip), %rsi      # 0x110a9
movl $0x353, %edx            # imm = 0x353
leaq 0x70d0(%rip), %rcx      # 0x110be
callq 0x20e0
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
jmp 0xa00e
movq -0x8(%rbp), %rax
movl $0x1, 0x2c(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl $0x1, %edi
movl $0x28, %esi
callq 0xaf30
movq %rax, -0x28(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq 0xaf90
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x8(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x20, %edi
callq 0x93f0
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
movl %eax, %edi
movl $0x8, %esi
callq 0xaf30
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x4(%rbp), %eax
movl %eax, %edi
movl $0x8, %esi
callq 0xaf30
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x4(%rbp), %eax
movl %eax, %edi
movl $0x8, %esi
callq 0xaf30
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2030
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2030
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2030
movq -0x8(%rbp), %rdi
callq 0x2030
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl $0x30, %edi
callq 0x93f0
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x6, -0x14(%rbp)
jae 0xb78d
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
shlq $0x3, %rdi
callq 0x93f0
movq %rax, %rdx
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x4(%rbp), %eax
ja 0xb780
movl $0x28, %edi
callq 0x93f0
movq %rax, %rdx
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x18(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xb74e
jmp 0xb782
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xb720
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x6, -0x10(%rbp)
jae 0xb808
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
ja 0xb7ed
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2030
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xb7c3
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2030
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xb7b6
movq -0x8(%rbp), %rdi
callq 0x2030
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_get_first_gs_core
hwc_gs_t*
mctop_get_first_gs_core(mctop_t* topo)
{
  hwc_gs_t* gs = topo->sockets[0].children[0];
  while (gs && gs->type != CORE)
    {
      gs = gs->children[0];
    }
  return gs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x11(%rbp)
je 0xbae5
movq -0x10(%rbp), %rax
cmpl $0x1, 0x8(%rax)
setne %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0xbaee
jmp 0xbaff
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xbacb
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0xba90
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x19(%rbp)
je 0xbb48
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0xc(%rbp), %eax
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0xbb51
jmp 0xbb62
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xbb2c
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_get_first_sibling_lvl
inline sibling_t*
mctop_get_first_sibling_lvl(mctop_t* topo, const uint lvl)
{
  for (int i = 0; i < topo->n_siblings; i++)
    {
      if (topo->siblings[i]->level == lvl)
	{
	  return topo->siblings[i];
	}
    }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x48(%rcx), %eax
jae 0xbbc9
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0xbbbc
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x8(%rbp)
jmp 0xbbd1
jmp 0xbbbe
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xbb82
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x48(%rcx), %eax
jae 0xbcf8
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xbd10
cmpl $0x0, %eax
je 0xbceb
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xbd00
jmp 0xbced
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xbcab
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_sibling_contains_sockets
uint
mctop_sibling_contains_sockets(sibling_t* sibling, socket_t* s0, socket_t* s1)
{
  if ((sibling->left == s0 && sibling->right == s1) ||
      (sibling->left == s1 && sibling->right == s0))
    {
      return 1;
    }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0xbd3c
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x20(%rbp), %rax
je 0xbd58
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0xbd61
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0xbd61
movl $0x1, -0x4(%rbp)
jmp 0xbd68
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xbdd2
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xbdb5
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
jmp 0xbdc8
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xbdda
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_socket_get_first_gs_core
hwc_gs_t*
mctop_socket_get_first_gs_core(socket_t* socket)
{
  hwc_gs_t* gs = socket->children[0];
  while (gs && gs->type != CORE)
    {
      gs = gs->children[0];
    }
  return gs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x11(%rbp)
je 0xbed1
movq -0x10(%rbp), %rax
cmpl $0x1, 0x8(%rax)
setne %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0xbeda
jmp 0xbeeb
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xbeb7
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x1d(%rbp)
je 0xbf34
movq -0x18(%rbp), %rax
cmpl $0x1, 0x8(%rax)
setne %al
movb %al, -0x1d(%rbp)
movb -0x1d(%rbp), %al
testb $0x1, %al
jne 0xbf3d
jmp 0xbf4e
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xbf1a
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0xbf74
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xbf55
movq -0x18(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_socket_get_first_child_lvl
hwc_gs_t*
mctop_socket_get_first_child_lvl(socket_t* socket, const uint lvl)
{
  hwc_gs_t* cur = socket->children[0];
  while (cur != NULL && cur->level != lvl)
    {
      cur = cur->children[0];
    }
  return cur;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x19(%rbp)
je 0xbfb6
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0xc(%rbp), %eax
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0xbfbf
jmp 0xbfd0
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xbf9a
movq -0x18(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x14(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x6c(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rcx
movb $0x1, %al
cmpl $0x0, 0x28(%rcx)
movb %al, -0x25(%rbp)
jne 0xc1ea
movl -0x24(%rbp), %eax
movl %eax, -0x2c(%rbp)
callq 0x22a0
movl %eax, %ecx
movl -0x2c(%rbp), %eax
cmpl %ecx, %eax
setne %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0xc20f
movl -0x24(%rbp), %edi
callq 0x2270
movl $0x1, -0x4(%rbp)
jmp 0xc216
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/mctop_control.c
// Function: mctop_hwcid_get_core
hwc_gs_t*
mctop_hwcid_get_core(mctop_t* topo, const uint hwcid)
{
  hw_context_t* hwc = &topo->hwcs[hwcid];
  if (hwc->type == CORE)
    {
      return (hwc_gs_t*) hwc;
    }
  else
    {
      return hwc->parent;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x14(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0xc2b5
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xc2c1
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xc250
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xbe60
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0x25(%rbp)
je 0xc31e
movq -0x20(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
setne %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0xc327
jmp 0xc33e
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0xc303
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)