LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/McLachlan.c
// Function: center_of_mass
static void center_of_mass(double *ret, double *v, int N, double *mass)
{
  int i, m=0; double norm=0;

  for(i=0;i<3;i++)ret[i] = 0;
  for(i=0;i<N;i++){
    double w=mass[i];
    ret[0] += w*v[m];
    ret[1] += w*v[m+1];
    ret[2] += w*v[m+2];
    norm+=w; m+=3;
  }
  for(i=0;i<3;i++)ret[i]/= norm;
}

// Assembly:
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
testl %edx, %edx
jle 0x4f497
movl %edx, %eax
addq $0x10, %rsi
xorpd %xmm1, %xmm1
xorl %edx, %edx
xorpd %xmm2, %xmm2
xorpd %xmm3, %xmm3
xorpd %xmm0, %xmm0
movsd (%rcx,%rdx,8), %xmm4
movsd -0x10(%rsi), %xmm5
mulsd %xmm4, %xmm5
addsd %xmm5, %xmm3
movsd %xmm3, (%rdi)
movsd -0x8(%rsi), %xmm5
mulsd %xmm4, %xmm5
addsd %xmm5, %xmm2
movsd %xmm2, 0x8(%rdi)
addsd %xmm4, %xmm0
mulsd (%rsi), %xmm4
addsd %xmm4, %xmm1
movsd %xmm1, 0x10(%rdi)
incq %rdx
addq $0x18, %rsi
cmpq %rdx, %rax
jne 0x4f450
jmp 0x4f49b
xorpd %xmm0, %xmm0
xorl %eax, %eax
movsd (%rdi,%rax,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rdi,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x4f49d
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/EC.c
// Function: CV_profile
float *CV_profile(double **Corr, int N)
{
  float *CV=malloc(N*sizeof(float));
  for(int i=0; i<N; i++){
    double sum=0, *c=Corr[i];
    for(int j=0; j<N; j++)sum+=c[j];
    CV[i]=sum;
  }
  return(CV);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movslq %esi, %r14
leaq (,%r14,4), %rdi
callq 0x21e0
testl %r14d, %r14d
jle 0x4ff83
movl %ebp, %ecx
xorl %edx, %edx
movq (%rbx,%rdx,8), %rsi
xorpd %xmm0, %xmm0
xorl %edi, %edi
addsd (%rsi,%rdi,8), %xmm0
incq %rdi
cmpq %rdi, %rcx
jne 0x4ff65
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rax,%rdx,4)
incq %rdx
cmpq %rcx, %rdx
jne 0x4ff5b
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/EC.c
// Function: C1sqr_over_C2
float C1sqr_over_C2(double **Corr, int N, int l)
{
  int i, j;
  double *ci=malloc(N*sizeof(double));
  for(i=0; i<N; i++){
    ci[i]=0; double *cc=Corr[i];
    for(j=0; j<=(i-l); j++){
      ci[i]+=cc[j];
      ci[j]+=cc[j];
    }
  }
  double c1=0, c2=0;
  for(i=0; i<N; i++){c1+=ci[i]; c2+=ci[i]*ci[i];}
  free(ci);
  return((c1*c1)/(N*c2));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
movslq %esi, %r15
leaq (,%r15,8), %rdi
callq 0x21e0
xorpd %xmm2, %xmm2
testl %r15d, %r15d
jle 0x50031
movl $0x1, %edx
subl %ebp, %edx
movslq %ebp, %rsi
movl %ebx, %ecx
xorl %edi, %edi
movl %edx, %edx
movq $0x0, (%rax,%rdi,8)
cmpq %rsi, %rdi
jl 0x4fffe
movq (%r14,%rdi,8), %r8
xorl %r9d, %r9d
movsd (%r8,%r9,8), %xmm0
movsd (%rax,%rdi,8), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rax,%rdi,8)
addsd (%rax,%r9,8), %xmm0
movsd %xmm0, (%rax,%r9,8)
incq %r9
cmpq %r9, %rdx
jne 0x4ffd6
incq %rdi
incl %edx
cmpq %rcx, %rdi
jne 0x4ffc0
xorpd %xmm1, %xmm1
testl %ebx, %ebx
jle 0x50035
xorl %edx, %edx
xorpd %xmm2, %xmm2
movsd (%rax,%rdx,8), %xmm0
addsd %xmm0, %xmm2
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm1
incq %rdx
cmpq %rdx, %rcx
jne 0x50016
jmp 0x50035
xorpd %xmm1, %xmm1
movsd %xmm2, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
movq %rax, %rdi
callq 0x2050
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd 0x10(%rsp), %xmm0
divsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/gasdev.c
// Function: gasdev
float gasdev(long *idum)
{
  float ran2(long *idum);
  static int iset=0;
  static float gset;
  float fac,r,v1,v2;
  float ran1();
  
  if  (iset == 0) {
    do {
      v1=2.0*ran2(idum)-1.0;
      v2=2.0*ran2(idum)-1.0;
      r=v1*v1+v2*v2;
    } while (r >= 1.0);
    fac=sqrt(-2.0*log(r)/r);
    gset=v1*fac;
    iset=1;
    return v2*fac;
  } else {
    iset=0;
    return gset;
  }
}

// Assembly:
cmpb $0x0, 0x2a985(%rip)     # 0x7aad8
je 0x50165
movb $0x0, 0x2a97c(%rip)     # 0x7aad8
movss 0x2a978(%rip), %xmm0    # 0x7aadc
retq
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rbx, %rdi
callq 0x50238
cvtss2sd %xmm0, %xmm0
addsd %xmm0, %xmm0
movsd 0x5f73(%rip), %xmm1     # 0x560f8
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x50238
movss (%rsp), %xmm3
cvtss2sd %xmm0, %xmm0
addsd %xmm0, %xmm0
addsd 0x5f49(%rip), %xmm0     # 0x560f8
xorps %xmm2, %xmm2
cvtsd2ss %xmm0, %xmm2
movaps %xmm2, %xmm1
mulss %xmm2, %xmm1
movaps %xmm3, %xmm0
mulss %xmm3, %xmm0
addss %xmm1, %xmm0
ucomiss 0xf4d(%rip), %xmm0      # 0x5111c
jae 0x5016d
movss %xmm2, 0x4(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x2120
mulsd 0x717a(%rip), %xmm0     # 0x57368
divsd 0x8(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x50203
sqrtsd %xmm0, %xmm0
jmp 0x50208
callq 0x22a0
movss (%rsp), %xmm1
xorps %xmm2, %xmm2
cvtsd2ss %xmm0, %xmm2
mulss %xmm2, %xmm1
movss %xmm1, 0x2a8bc(%rip)    # 0x7aadc
movb $0x1, 0x2a8b1(%rip)     # 0x7aad8
movss 0x4(%rsp), %xmm0
mulss %xmm2, %xmm0
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/ran2.c
// Function: ran2
float ran2(long *idum)
{
  static long iy,ir[98];
  static int iff=0;
  int j;
  void nrerror();
  
  if (*idum < 0 || iff == 0) {
    iff=1;
    if ((*idum=(IC-(*idum)) % M) < 0) *idum = -(*idum);
    for (j=1;j<=97;j++) {
      *idum=(IA*(*idum)+IC) % M;
      ir[j]=(*idum);
    }
    *idum=(IA*(*idum)+IC) % M;
    iy=(*idum);
  }
  j=1 + 97.0*iy/M;
  if (j > 97 || j < 1) nrerror("RAN2: This cannot happen.");
  iy=ir[j];
  *idum=(IA*(*idum)+IC) % M;
  ir[j]=(*idum);
  return (float) iy/M;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movabsq $0x5dfc995681872319, %r14 # imm = 0x5DFC995681872319
testq %rax, %rax
js 0x50267
testb $0x1, 0x2aba7(%rip)     # 0x7ae00
je 0x50267
movq 0x2a87e(%rip), %rcx     # 0x7aae0
jmp 0x5030f
movb $0x1, 0x2ab92(%rip)     # 0x7ae00
movl $0x24d69, %esi          # imm = 0x24D69
subq %rax, %rsi
movq %rsi, %rax
imulq %r14
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x12, %rdx
addq %rax, %rdx
imulq $0xae529, %rdx, %rax    # imm = 0xAE529
subq %rax, %rsi
movq %rsi, %rcx
negq %rcx
cmovsq %rsi, %rcx
movl $0x1, %esi
leaq 0x2a846(%rip), %rdi     # 0x7aaf0
imulq $0x556, %rcx, %rcx      # imm = 0x556
addq $0x24d69, %rcx          # imm = 0x24D69
movq %rcx, %rax
mulq %r14
shrq $0x12, %rdx
imulq $0xae529, %rdx, %rax    # imm = 0xAE529
subq %rax, %rcx
movq %rcx, (%rdi,%rsi,8)
incq %rsi
cmpq $0x62, %rsi
jne 0x502aa
imull $0x556, %ecx, %eax      # imm = 0x556
addl $0x24d69, %eax          # imm = 0x24D69
imulq $0x77f2655b, %rax, %rcx # imm = 0x77F2655B
shrq $0x20, %rcx
movl %eax, %edx
subl %ecx, %edx
shrl %edx
addl %ecx, %edx
shrl $0x13, %edx
imull $0xae529, %edx, %ecx    # imm = 0xAE529
subl %ecx, %eax
movq %rax, (%rbx)
movq %rax, 0x2a7d4(%rip)     # 0x7aae0
movq %rax, %rcx
cvtsi2sd %rcx, %xmm0
mulsd 0xe104(%rip), %xmm0     # 0x5e420
divsd 0xe104(%rip), %xmm0     # 0x5e428
addsd 0xe1c(%rip), %xmm0      # 0x51148
cvttsd2si %xmm0, %r15d
leal -0x62(%r15), %ecx
cmpl $-0x62, %ecx
ja 0x5034b
leaq 0xe0f3(%rip), %rdi      # 0x5e434
xorl %eax, %eax
callq 0x4ae38
movq (%rbx), %rax
movslq %r15d, %rsi
leaq 0x2a79b(%rip), %rdi     # 0x7aaf0
movq (%rdi,%rsi,8), %r8
imulq $0x556, %rax, %rcx      # imm = 0x556
addq $0x24d69, %rcx          # imm = 0x24D69
movq %rcx, %rax
imulq %r14
movq %r8, 0x2a76c(%rip)      # 0x7aae0
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x12, %rdx
addq %rax, %rdx
imulq $0xae529, %rdx, %rax    # imm = 0xAE529
subq %rax, %rcx
movq %rcx, (%rbx)
xorps %xmm0, %xmm0
cvtsi2ss %r8, %xmm0
movq %rcx, (%rdi,%rsi,8)
divss 0xe08d(%rip), %xmm0     # 0x5e430
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/random3.c
// Function: Random
RANDOMTYPE Random()
{
  /* create random number */
  if( ++random_which1 == random_end)
    {
      random_which1= random_array;
    }
  if( ++random_which2 == random_end)
    {
      random_which2= random_array;
    }
  if( ++random_which3 == random_end)
    {
      random_which3= random_array;
    }
  if( ++random_which4 == random_end)
    {
      random_which4= random_array;
    }
  if( ++random_which5 == random_end)
    {
      random_which5= random_array;
    }
  
  return( *random_which1=
	  *random_which2 ^ *random_which3 ^ *random_which4 ^ *random_which5);
}

// Assembly:
movq 0x4a9bd(%rip), %rcx     # 0x9ae10
addq $0x8, %rcx
movq 0x4a9da(%rip), %rax     # 0x9ae38
cmpq %rax, %rcx
leaq 0x2a9a8(%rip), %rdx     # 0x7ae10
cmoveq %rdx, %rcx
movq %rcx, 0x4a99d(%rip)     # 0x9ae10
movq 0x4a99e(%rip), %rsi     # 0x9ae18
addq $0x8, %rsi
cmpq %rax, %rsi
cmoveq %rdx, %rsi
movq %rsi, 0x4a98c(%rip)     # 0x9ae18
movq 0x4a98d(%rip), %rdi     # 0x9ae20
addq $0x8, %rdi
cmpq %rax, %rdi
cmoveq %rdx, %rdi
movq %rdi, 0x4a97b(%rip)     # 0x9ae20
movq 0x4a97c(%rip), %r8      # 0x9ae28
addq $0x8, %r8
cmpq %rax, %r8
cmoveq %rdx, %r8
movq %r8, 0x4a96a(%rip)      # 0x9ae28
movq 0x4a96b(%rip), %r9      # 0x9ae30
addq $0x8, %r9
cmpq %rax, %r9
cmoveq %rdx, %r9
movq %r9, 0x4a959(%rip)      # 0x9ae30
movq (%rdi), %rax
xorq (%rsi), %rax
xorq (%r8), %rax
xorq (%r9), %rax
movq %rax, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/random3.c
// Function: RandomFloating
double RandomFloating()
{
  /* create random number */
  if( ++random_which1 == random_end)
    {
      random_which1= random_array;
    }
  if( ++random_which2 == random_end)
    {
      random_which2= random_array;
    }
  if( ++random_which3 == random_end)
    {
      random_which3= random_array;
    }
  if( ++random_which4 == random_end)
    {
      random_which4= random_array;
    }
  if( ++random_which5 == random_end)
    {
      random_which5= random_array;
    }
  
  return( INVRANDOMLIMITFLOATING*
	  (double)(*random_which1=
		   *random_which2 ^ *random_which3 ^ 
		   *random_which4 ^ *random_which5));
}

// Assembly:
movq 0x4a922(%rip), %rax     # 0x9ae10
addq $0x8, %rax
movq 0x4a93f(%rip), %rcx     # 0x9ae38
cmpq %rcx, %rax
leaq 0x2a90d(%rip), %rdx     # 0x7ae10
cmoveq %rdx, %rax
movq %rax, 0x4a902(%rip)     # 0x9ae10
movq 0x4a903(%rip), %rsi     # 0x9ae18
addq $0x8, %rsi
cmpq %rcx, %rsi
cmoveq %rdx, %rsi
movq %rsi, 0x4a8f1(%rip)     # 0x9ae18
movq 0x4a8f2(%rip), %rdi     # 0x9ae20
addq $0x8, %rdi
cmpq %rcx, %rdi
cmoveq %rdx, %rdi
movq %rdi, 0x4a8e0(%rip)     # 0x9ae20
movq 0x4a8e1(%rip), %r8      # 0x9ae28
addq $0x8, %r8
cmpq %rcx, %r8
cmoveq %rdx, %r8
movq %r8, 0x4a8cf(%rip)      # 0x9ae28
movq 0x4a8d0(%rip), %r9      # 0x9ae30
addq $0x8, %r9
cmpq %rcx, %r9
cmoveq %rdx, %r9
movq %r9, 0x4a8be(%rip)      # 0x9ae30
movq (%rdi), %rcx
xorq (%rsi), %rcx
xorq (%r8), %rcx
xorq (%r9), %rcx
movq %rcx, (%rax)
movq %rcx, %xmm1
punpckldq 0xdec2(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xdeca(%rip), %xmm1     # 0x5e460
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0xdec6(%rip), %xmm0     # 0x5e470
retq
// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/random3.c
// Function: Norm_var_2
float Norm_var_2(){
  // Draws squared Gaussian variable z^2 with Box-Muller transform method
  float U1=RandomFloating();
  float U2=RandomFloating();
  float c=cos(TWOPI*U2);
  return(-2*log(U1)*c*c);
}

// Assembly:
pushq %rax
callq 0x504e7
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
callq 0x504e7
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0xdea8(%rip), %xmm0     # 0x5e478
callq 0x2130
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
callq 0x2120
mulsd 0x6d74(%rip), %xmm0     # 0x57368
cvtss2sd (%rsp), %xmm1
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: new_bs_tree
bs_tree *new_bs_tree(int (* comp) (const void *, const void *)) {

    // Sanity check:
    assert(comp != NULL);

    // Allocate memory:
    bs_tree *tree = (bs_tree *) malloc(sizeof(bs_tree));
    if (tree == NULL) {
        fprintf(stderr, "ERROR: Unable to allocate memory for bs_tree\n");
    }

    // Initialize the empty tree:
    else {
        tree->root = NULL;
        tree->comp = comp;
    }

    return tree;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x79f3
movq %rdi, %rbx
movl $0x10, %edi
callq 0x10d0
movq %rax, %r14
testq %rax, %rax
je 0x79ec
movq $0x0, (%r14)
movq %rbx, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x1130
jmp 0x79e1
leaq 0x6806(%rip), %rdi      # 0xe200
leaq 0x680c(%rip), %rsi      # 0xe20d
leaq 0x6813(%rip), %rcx      # 0xe21b
movl $0x52, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: bs_tree_insert
void *bs_tree_insert(bs_tree *tree, void *data) {

    bs_node *node;
    bs_node *new_node;
    void    *old_data;
    int      comp;

    // Sanity Checks:
    assert(tree != NULL);
    assert(data != NULL);

    // Avoid the trivial case: empty tree
    node = NULL;
    if (tree->root != NULL) {

        // Search for the correct place to insert data:
        node = tree->root;
        for (;;) {

            // Compare data:
            comp = (tree->comp)(data, node->data);

            // Data is smaller:
            if (comp < 0) {
                if (node->left == NULL) { break; }
                else { node = node->left; }
            }

            // Data is bigger:
            else if (comp > 0) {
                if (node->right == NULL) { break; }
                else { node = node->right; }
            }

            // Data is already there: overwrite it!
            else {
                old_data   = node->data;
                node->data = data;
                return old_data;
            }
        }
    }

    // Insert the new node here:
    new_node = (bs_node *) malloc(sizeof(bs_node));
    if (new_node == NULL) {
        fprintf(stderr, "ERROR: Unable to allocate bs_node\n");
    } else {
        new_node->data  = data;
        new_node->left  = NULL;
        new_node->right = NULL;
    }

    if (node == NULL)  { tree->root  = new_node; }
    else if (comp < 0) { node->left  = new_node; }
    else               { node->right = new_node; }

    // Data was not here!
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x7bd0
movq %rsi, %r14
testq %rsi, %rsi
je 0x7bef
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x7b77
movq %rax, %r12
movq (%rax), %rsi
movq %r14, %rdi
callq *0x8(%rbx)
movl %eax, %ebp
shrl $0x1f, %ebp
testl %eax, %eax
js 0x7b6b
je 0x7baf
movq 0x10(%r12), %rax
jmp 0x7b70
movq 0x8(%r12), %rax
testq %rax, %rax
jne 0x7b4d
jmp 0x7b7c
xorl %r12d, %r12d
xorl %ebp, %ebp
movl $0x18, %edi
callq 0x10d0
movq %rax, %r15
testq %rax, %rax
je 0x7bc9
movq %r14, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
testq %r12, %r12
je 0x7baa
testb %bpl, %bpl
je 0x7bb9
movq %r15, 0x8(%r12)
jmp 0x7bbe
movq %r15, (%rbx)
jmp 0x7bbe
movq (%r12), %rax
movq %r14, (%r12)
jmp 0x7bc0
movq %r15, 0x10(%r12)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x1168
jmp 0x7b99
leaq 0x66ac(%rip), %rdi      # 0xe283
leaq 0x662f(%rip), %rsi      # 0xe20d
leaq 0x66f5(%rip), %rcx      # 0xe2da
movl $0xc2, %edx
callq 0x1080
leaq 0x670c(%rip), %rdi      # 0xe302
leaq 0x6610(%rip), %rsi      # 0xe20d
leaq 0x66d6(%rip), %rcx      # 0xe2da
movl $0xc3, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: bs_tree_insert_min
void *bs_tree_insert_min(bs_tree *tree, void *data) {

    bs_node *node;
    bs_node *new_node;
    void    *old_data;

    // Sanity Checks:
    assert(tree != NULL);
    assert(data != NULL);

    // Trivial case:
    if (tree->root == NULL) { node = NULL; }

    // General case:
    else {
        node = tree->root;
        while (node->left != NULL) { node = node->left; }

        // If "data" is already there: overwrite it & return!
        if ((tree->comp)(data, node->data) == 0) {
            old_data   = node->data;
            node->data = data;
            return old_data;
        }
    }

    // Finally: Insert the new node here
    new_node = (bs_node *) malloc(sizeof(bs_node));
    if (new_node == NULL) {
        fprintf(stderr, "ERROR: Unable to allocate bs_node\n");
    } else {
        new_node->data  = data;
        new_node->left  = NULL;
        new_node->right = NULL;
    }
    if (node == NULL) { tree->root = new_node; }
    else              { node->left = new_node; }

    // Data was not here!
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x7c9a
movq %rsi, %r14
testq %rsi, %rsi
je 0x7cb9
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x7c56
movq %rax, %r12
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x7c32
movq (%r12), %rsi
movq %r14, %rdi
callq *0x8(%rbx)
testl %eax, %eax
jne 0x7c59
movq (%r12), %rax
movq %r14, (%r12)
jmp 0x7c87
xorl %r12d, %r12d
movl $0x18, %edi
callq 0x10d0
movq %rax, %r15
testq %rax, %rax
je 0x7c93
movq %r14, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
testq %r12, %r12
je 0x7c82
movq %r15, 0x8(%r12)
jmp 0x7c85
movq %r15, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x1184
jmp 0x7c76
leaq 0x65e2(%rip), %rdi      # 0xe283
leaq 0x6565(%rip), %rsi      # 0xe20d
leaq 0x6660(%rip), %rcx      # 0xe30f
movl $0x109, %edx            # imm = 0x109
callq 0x1080
leaq 0x6642(%rip), %rdi      # 0xe302
leaq 0x6546(%rip), %rsi      # 0xe20d
leaq 0x6641(%rip), %rcx      # 0xe30f
movl $0x10a, %edx            # imm = 0x10A
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: bs_tree_insert_max
void *bs_tree_insert_max(bs_tree *tree, void *data) {

    bs_node *node;
    bs_node *new_node;
    void    *old_data;

    // Sanity Checks:
    assert(tree != NULL);
    assert(data != NULL);

    // Trivial case:
    if (tree->root == NULL) { node = NULL; }

    // General case:
    else {
        node = tree->root;
        while (node->right != NULL) { node = node->right; }

        // If "data" is already there: overwrite it & return!
        if ((tree->comp)(data, node->data) == 0) {
            old_data   = node->data;
            node->data = data;
            return old_data;
        }
    }

    // Finally: Insert the new node here
    new_node = (bs_node *) malloc(sizeof(bs_node));
    if (new_node == NULL) {
        fprintf(stderr, "ERROR: Unable to allocate bs_node\n");
    } else {
        new_node->data  = data;
        new_node->left  = NULL;
        new_node->right = NULL;
    }
    if (node == NULL) { tree->root  = new_node; }
    else              { node->right = new_node; }

    // Data was not here!
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x7d64
movq %rsi, %r14
testq %rsi, %rsi
je 0x7d83
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x7d20
movq %rax, %r12
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x7cfc
movq (%r12), %rsi
movq %r14, %rdi
callq *0x8(%rbx)
testl %eax, %eax
jne 0x7d23
movq (%r12), %rax
movq %r14, (%r12)
jmp 0x7d51
xorl %r12d, %r12d
movl $0x18, %edi
callq 0x10d0
movq %rax, %r15
testq %rax, %rax
je 0x7d5d
movq %r14, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
testq %r12, %r12
je 0x7d4c
movq %r15, 0x10(%r12)
jmp 0x7d4f
movq %r15, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x11a0
jmp 0x7d40
leaq 0x6518(%rip), %rdi      # 0xe283
leaq 0x649b(%rip), %rsi      # 0xe20d
leaq 0x65c2(%rip), %rcx      # 0xe33b
movl $0x13e, %edx            # imm = 0x13E
callq 0x1080
leaq 0x6578(%rip), %rdi      # 0xe302
leaq 0x647c(%rip), %rsi      # 0xe20d
leaq 0x65a3(%rip), %rcx      # 0xe33b
movl $0x13f, %edx            # imm = 0x13F
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: bs_tree_search
void *bs_tree_search(const bs_tree *tree, const void *data) {

    bs_node *node;
    int      comp;

    // Sanity Checks:
    assert(tree != NULL);
    assert(data != NULL);

    // Search:
    node = tree->root;
    while (node != NULL) {
        comp = (tree->comp)(data, node->data);      // compare data
        if      (comp < 0) { node = node->left;  }  // data is smaller
        else if (comp > 0) { node = node->right; }  // data is bigger
        else               { return node->data;  }  // found!
    }

    // Not found:
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x7e2a
movq %rsi, %rbx
testq %rsi, %rsi
je 0x7e49
movq %rdi, %r14
movq (%rdi), %r12
xorl %r15d, %r15d
testq %r12, %r12
je 0x7e1b
movq (%r12), %rsi
movq %rbx, %rdi
callq *0x8(%r14)
testl %eax, %eax
js 0x7e0c
movl $0x10, %eax
jne 0x7e11
jmp 0x7e17
movl $0x8, %eax
movq (%r12,%rax), %r12
jmp 0x7def
movq (%r12), %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x6452(%rip), %rdi      # 0xe283
leaq 0x63d5(%rip), %rsi      # 0xe20d
leaq 0x654e(%rip), %rcx      # 0xe38d
movl $0x179, %edx            # imm = 0x179
callq 0x1080
leaq 0x64b2(%rip), %rdi      # 0xe302
leaq 0x63b6(%rip), %rsi      # 0xe20d
leaq 0x652f(%rip), %rcx      # 0xe38d
movl $0x17a, %edx            # imm = 0x17A
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: bs_tree_min
void *bs_tree_min(const bs_tree *tree) {

    bs_node *node;

    // Sanity check:
    assert(tree != NULL);

    // Trivial case: empty tree
    if (tree->root == NULL) { return NULL; }

    // General case: Find the smallest node
    node = tree->root;
    while (node->left != NULL) { node = node->left; }

    // Return a pointer to the data:
    return node->data;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x7e8b
movq (%rdi), %rax
testq %rax, %rax
je 0x7e87
movq %rax, %rcx
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x7e76
movq (%rcx), %rax
jmp 0x7e89
xorl %eax, %eax
popq %rcx
retq
leaq 0x63f1(%rip), %rdi      # 0xe283
leaq 0x6374(%rip), %rsi      # 0xe20d
leaq 0x6521(%rip), %rcx      # 0xe3c1
movl $0x191, %edx            # imm = 0x191
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: bs_tree_max
void *bs_tree_max(const bs_tree *tree) {

    bs_node *node;

    // Sanity check:
    assert(tree != NULL);

    // Trivial case: empty tree
    if (tree->root == NULL) { return NULL; }

    // General case: Find the biggest node
    node = tree->root;
    while (node->right != NULL) { node = node->right; }

    // Return a pointer to the data:
    return node->data;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x7ecd
movq (%rdi), %rax
testq %rax, %rax
je 0x7ec9
movq %rax, %rcx
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x7eb8
movq (%rcx), %rax
jmp 0x7ecb
xorl %eax, %eax
popq %rcx
retq
leaq 0x63af(%rip), %rdi      # 0xe283
leaq 0x6332(%rip), %rsi      # 0xe20d
leaq 0x6502(%rip), %rcx      # 0xe3e4
movl $0x1a6, %edx            # imm = 0x1A6
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: bs_tree_prev
void *bs_tree_prev(const bs_tree *tree, const void *data) {

    bs_node *node;
    bs_node *pred;
    int      comp;

    // Sanity Checks:
    assert(tree != NULL);
    assert(data != NULL);

    // Search:
    pred = NULL;
    node = tree->root;
    while (node != NULL) {

        // Compare data:
        comp = (tree->comp)(data, node->data);

        // Data is smaller:
        if (comp < 0) { node = node->left; }

        // Data is bigger:
        else if (comp > 0) {
            pred = node;
            node = node->right;
        }

        // We have found the node:
        else if (node->left != NULL) {
            pred = node->left;
            while (pred->right != NULL) { pred = pred->right; }
            break;
        } else { break; }
    }

    // Return predecesor:
    if (pred == NULL) { return NULL; }
    return pred->data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x7f71
movq %rsi, %rbx
testq %rsi, %rsi
je 0x7f90
movq %rdi, %r14
movq (%rdi), %r15
testq %r15, %r15
je 0x7f46
xorl %r12d, %r12d
movq (%r15), %rsi
movq %rbx, %rdi
callq *0x8(%r14)
testl %eax, %eax
js 0x7f2d
movl $0x10, %ecx
movq %r15, %rax
jne 0x7f35
jmp 0x7f4a
movl $0x8, %ecx
movq %r12, %rax
movq (%r15,%rcx), %r15
movq %rax, %r12
testq %r15, %r15
jne 0x7f13
testq %rax, %rax
jne 0x7f62
xorl %eax, %eax
jmp 0x7f65
movq 0x8(%r15), %rcx
movq %r12, %rax
testq %rcx, %rcx
je 0x7f41
movq %rcx, %rax
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0x7f56
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x630b(%rip), %rdi      # 0xe283
leaq 0x628e(%rip), %rsi      # 0xe20d
leaq 0x6481(%rip), %rcx      # 0xe407
movl $0x1bf, %edx            # imm = 0x1BF
callq 0x1080
leaq 0x636b(%rip), %rdi      # 0xe302
leaq 0x626f(%rip), %rsi      # 0xe20d
leaq 0x6462(%rip), %rcx      # 0xe407
movl $0x1c0, %edx            # imm = 0x1C0
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: bs_tree_next
void *bs_tree_next(const bs_tree *tree, const void *data) {

    bs_node *node;
    bs_node *succ;
    int      comp;

    // Sanity Checks:
    assert(tree != NULL);
    assert(data != NULL);

    // Search:
    succ = NULL;
    node = tree->root;
    while (node != NULL) {

        // Compare data:
        comp = (tree->comp)(data, node->data);

        // Data is smaller:
        if (comp < 0) {
            succ = node;
            node = node->left;
        }

        // Data is bigger:
        else if (comp > 0) { node = node->right; }

        // We have found the node:
        else if (node->right != NULL) {
            succ = node->right;
            while (succ->left != NULL) { succ = succ->left; }
            break;
        } else { break; }
    }

    // Return succesor:
    if (succ == NULL) { return NULL; }
    return succ->data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x802d
movq %rsi, %rbx
testq %rsi, %rsi
je 0x804c
movq %rdi, %r14
movq (%rdi), %r12
testq %r12, %r12
je 0x8004
xorl %r15d, %r15d
movq (%r12), %rsi
movq %rbx, %rdi
callq *0x8(%r14)
testl %eax, %eax
js 0x7fee
movl $0x10, %eax
jne 0x7ff6
jmp 0x8008
movl $0x8, %eax
movq %r12, %r15
movq (%r12,%rax), %r12
testq %r12, %r12
jne 0x7fd6
testq %r15, %r15
jne 0x801e
xorl %eax, %eax
jmp 0x8021
movq 0x10(%r12), %rax
testq %rax, %rax
je 0x7fff
movq %rax, %r15
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x8012
movq (%r15), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x624f(%rip), %rdi      # 0xe283
leaq 0x61d2(%rip), %rsi      # 0xe20d
leaq 0x63f7(%rip), %rcx      # 0xe439
movl $0x1ec, %edx            # imm = 0x1EC
callq 0x1080
leaq 0x62af(%rip), %rdi      # 0xe302
leaq 0x61b3(%rip), %rsi      # 0xe20d
leaq 0x63d8(%rip), %rcx      # 0xe439
movl $0x1ed, %edx            # imm = 0x1ED
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: bs_tree_remove_min
void *bs_tree_remove_min(bs_tree *tree) {

    bs_node *node;
    bs_node *parent;
    void    *old_data;

    // Sanity check:
    assert(tree != NULL);

    // Avoid trivial case: empty tree
    old_data = NULL;
    if (tree->root != NULL) {

        // General case: Find the smallest node
        parent = NULL;
        node   = tree->root;
        while (node->left != NULL) {
            parent = node;
            node   = node->left;
        }
        old_data = node->data;

        // Remove Node:
        if (parent != NULL) { parent->left = node->right; }
        else                { tree->root   = node->right; }
        free(node);
    }
    return old_data;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x81d0
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x81c9
xorl %eax, %eax
movq %rax, %rdx
movq %rcx, %rax
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
jne 0x819b
movq (%rax), %rbx
movq 0x10(%rax), %rcx
leaq 0x8(%rdx), %rsi
testq %rdx, %rdx
cmoveq %rdi, %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x1120
jmp 0x81cb
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
leaq 0x60ac(%rip), %rdi      # 0xe283
leaq 0x602f(%rip), %rsi      # 0xe20d
leaq 0x62b4(%rip), %rcx      # 0xe499
movl $0x277, %edx            # imm = 0x277
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: bs_tree_remove_max
void *bs_tree_remove_max(bs_tree *tree) {

    bs_node *node;
    bs_node *parent;
    void        *old_data;

    // Sanity check:
    assert(tree != NULL);

    // Avoid trivial case: empty tree
    old_data = NULL;
    if (tree->root != NULL) {

        // General case: Find the biggest node
        parent = NULL;
        node   = tree->root;
        while (node->right != NULL) {
            parent = node;
            node   = node->right;
        }
        old_data = node->data;

        // Remove Node:
        if (parent != NULL) { parent->right = node->left; }
        else                { tree->root    = node->left; }
        free(node);
    }
    return old_data;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x8234
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x822d
xorl %eax, %eax
movq %rax, %rdx
movq %rcx, %rax
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0x81ff
movq (%rax), %rbx
movq 0x8(%rax), %rcx
leaq 0x10(%rdx), %rsi
testq %rdx, %rdx
cmoveq %rdi, %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x1120
jmp 0x822f
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
leaq 0x6048(%rip), %rdi      # 0xe283
leaq 0x5fcb(%rip), %rsi      # 0xe20d
leaq 0x6274(%rip), %rcx      # 0xe4bd
movl $0x29b, %edx            # imm = 0x29B
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: bs_tree_remove_all
void bs_tree_remove_all(bs_tree *tree, void (* free_data) (void *)) {

    bs_node *root;
    bs_node *left;
    bs_node *right;

    // Sanity check:
    assert(tree != NULL);

    // Initialize:
    root = tree->root;
    tree->root = NULL;

    // While the tree is not empty:
    while (root != NULL) {

        // Unravel the tree: Rotate right "root" & "left"
        if (root->left != NULL) {
            left        = root->left;
            right       = left->right;
            left->right = root;
            root->left  = right;
            root        = left;

        // Erase the current "root" node:
        } else {
            right = root->right;
            if (free_data != NULL) { free_data(root->data); }
            free(root);
            root = right;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x82aa
movq (%rdi), %r14
movq $0x0, (%rdi)
testq %r14, %r14
je 0x82a4
movq %rsi, %rbx
movq 0x8(%r14), %r15
testq %r15, %r15
je 0x8286
movq 0x10(%r15), %rax
movq %r14, 0x10(%r15)
movq %rax, 0x8(%r14)
jmp 0x829c
movq 0x10(%r14), %r15
testq %rbx, %rbx
je 0x8294
movq (%r14), %rdi
callq *%rbx
movq %r14, %rdi
callq 0x1120
movq %r15, %r14
testq %r15, %r15
jne 0x826f
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5fd2(%rip), %rdi      # 0xe283
leaq 0x5f55(%rip), %rsi      # 0xe20d
leaq 0x6222(%rip), %rcx      # 0xe4e1
movl $0x2cc, %edx            # imm = 0x2CC
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: is_bs_tree
int is_bs_tree(const bs_tree *tree) {

    // Basic Sanity Checks:
    if (tree == NULL) {
        fprintf(stderr, "ERROR: NULL pointer to bs_tree\n");
        return NO;
    }
    if (tree->comp == NULL) {
        fprintf(stderr, "ERROR: NULL comparing function in bs_tree\n");
        return NO;
    }

    // Trivial Case: empty tree
    if (tree->root == NULL) { return YES; }

    // General Case:
    return is_bs_subtree(tree, tree->root, NULL, NULL);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x9517
cmpq $0x0, 0x8(%rdi)
je 0x951e
movq (%rdi), %rsi
testq %rsi, %rsi
je 0x9510
xorl %edx, %edx
xorl %ecx, %ecx
popq %rax
jmp 0x9527
movl $0x1, %eax
jmp 0x9525
callq 0x12b8
jmp 0x9523
callq 0x129c
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: is_bs_subtree
static int is_bs_subtree(const bs_tree *tree, const bs_node *node,
                         const void *min, const void *max) {

    // Make sure that node is (strictly) between specified limits:
    if (min != NULL && (tree->comp)(min, node->data) >= 0) {
        fprintf(stderr,"ERROR: Symmetric order not satisfied in bs_tree\n");
        return NO;
    }
    if (max != NULL && (tree->comp)(node->data, max) >= 0) {
        fprintf(stderr,"ERROR: Symmetric order not satisfied in bs_tree\n");
        return NO;
    }

    // Check recursively the left subtree of node:
    if (node->left != NULL) {
        if (is_bs_subtree(tree, node->left, min, node->data) == NO) {
            return NO;
        }
    }

    // Check recursively the right subtree of node:
    if (node->right != NULL) {
        if (is_bs_subtree(tree, node->right, node->data, max) == NO) {
            return NO;
        }
    }

    // All test are fine:
    return YES;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
testq %rdx, %rdx
je 0x954e
movq (%r15), %rsi
movq %r12, %rdi
callq *0x8(%r14)
testl %eax, %eax
jns 0x959e
testq %rbx, %rbx
je 0x9561
movq (%r15), %rdi
movq %rbx, %rsi
callq *0x8(%r14)
testl %eax, %eax
jns 0x95a5
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x957c
movq (%r15), %rcx
movq %r14, %rdi
movq %r12, %rdx
callq 0x9527
testl %eax, %eax
je 0x95aa
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0x9597
movq (%r15), %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x9527
testl %eax, %eax
je 0x95aa
movl $0x1, %eax
jmp 0x95ac
callq 0x12d4
jmp 0x95aa
callq 0x12f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: print_bs_tree
void print_bs_tree(const bs_tree *tree, void (* print_node) (const void *)) {

    // Avoid the trivial cases:
    if (tree != NULL && tree->root != NULL) {

        // Print right subtree recursively:
        if (tree->root->right != NULL) {
            print_bs_subtree(tree->root->right, YES, "     ", print_node);
        }

        // Print current node:
        fprintf(stdout, "----");
        if (print_node == NULL) { fprintf(stdout, "(#)"); }
        else     { print_node(tree->root->data); }
        fprintf(stdout, "\n");

        // Print left subtree recursively:
        if (tree->root->left != NULL) {
            print_bs_subtree(tree->root->left, NO, "     ", print_node);
        }
    }

    // Empty the "stdout" buffer:
    fflush(stdout);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x9667
movq %rdi, %r14
movq (%rdi), %rax
testq %rax, %rax
je 0x9667
movq %rsi, %rbx
movq 0x10(%rax), %rdi
testq %rdi, %rdi
je 0x95f5
leaq 0x5971(%rip), %rdx      # 0xef59
movl $0x1, %esi
movq %rbx, %rcx
callq 0x967b
movq 0x89dc(%rip), %r15      # 0x11fd8
movq (%r15), %rcx
leaq 0x5963(%rip), %rdi      # 0xef69
movl $0x4, %esi
movl $0x1, %edx
callq 0x1100
testq %rbx, %rbx
je 0x9624
movq (%r14), %rax
movq (%rax), %rdi
callq *%rbx
jmp 0x963d
movq (%r15), %rcx
leaq 0x50a9(%rip), %rdi      # 0xe6d7
movl $0x3, %esi
movl $0x1, %edx
callq 0x1100
movq (%r15), %rsi
movl $0xa, %edi
callq 0x1090
movq (%r14), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x9667
leaq 0x58fc(%rip), %rdx      # 0xef59
xorl %esi, %esi
movq %rbx, %rcx
callq 0x967b
movq 0x896a(%rip), %rax      # 0x11fd8
movq (%rax), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x10e0
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: print_bs_subtree
static void print_bs_subtree(const bs_node *node, const int is_right,
                             char *indent, void (* print_node) (const void *)) {

    // Allocate memory:
    char *new_indent = (char *) malloc((6+strlen(indent)*sizeof(char)));
    assert(new_indent != NULL);

    // Print right subtree recursively:
    if (node->right != NULL) {
        if (is_right == YES) { sprintf(new_indent, "%s%s", indent, "      "); }
        else                 { sprintf(new_indent, "%s%s", indent, "|     "); }
        print_bs_subtree(node->right, YES, new_indent, print_node);
    }

    // Print current node:
    if (is_right) { fprintf(stdout, "%s,----",indent); }
    else          { fprintf(stdout, "%s`----",indent); }
    if (print_node == NULL)  { fprintf(stdout, "(#)"); }
    else                     { print_node(node->data); }
    printf("\n");

    // Print left subtree recursively:
    if (node->left != NULL) {
        if (is_right == YES) { sprintf(new_indent, "%s%s", indent, "|     "); }
        else                 { sprintf(new_indent, "%s%s", indent, "      "); }
        print_bs_subtree(node->left, NO, new_indent, print_node);
    }

    // Free memory:
    free(new_indent);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r14
movq %rdx, %rdi
callq 0x1060
leaq 0x6(%rax), %rdi
callq 0x10d0
testq %rax, %rax
je 0x97a2
movq %rax, %r15
cmpq $0x0, 0x10(%r14)
je 0x96f2
cmpl $0x1, %ebp
leaq 0x5899(%rip), %rax      # 0xef58
leaq 0x5899(%rip), %rcx      # 0xef5f
cmoveq %rax, %rcx
leaq 0x5882(%rip), %rsi      # 0xef53
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10f0
movq 0x10(%r14), %rdi
movl $0x1, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x967b
testl %ebp, %ebp
movq 0x88dd(%rip), %r13      # 0x11fd8
movq (%r13), %rdi
leaq 0x5868(%rip), %rax      # 0xef6e
leaq 0x5859(%rip), %rsi      # 0xef66
cmoveq %rax, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10b0
testq %rbx, %rbx
je 0x9727
movq (%r14), %rdi
callq *%rbx
jmp 0x9741
movq (%r13), %rcx
leaq 0x4fa5(%rip), %rdi      # 0xe6d7
movl $0x3, %esi
movl $0x1, %edx
callq 0x1100
movl $0xa, %edi
callq 0x1030
cmpq $0x0, 0x8(%r14)
je 0x978c
cmpl $0x1, %ebp
leaq 0x5803(%rip), %rax      # 0xef5f
leaq 0x57f5(%rip), %rcx      # 0xef58
cmoveq %rax, %rcx
leaq 0x57e5(%rip), %rsi      # 0xef53
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10f0
movq 0x8(%r14), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x967b
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1120
leaq 0x5745(%rip), %rdi      # 0xeeee
leaq 0x4a5d(%rip), %rsi      # 0xe20d
leaq 0x574a(%rip), %rcx      # 0xef01
movl $0x83a, %edx            # imm = 0x83A
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: new_rb_tree
rb_tree *new_rb_tree(int (* comp) (const void *, const void *)) {

    // Sanity check:
    assert(comp != NULL);

    // Allocate memory:
    rb_tree *tree = (rb_tree *) malloc(sizeof(rb_tree));
    if (tree == NULL) {
        fprintf(stderr, "ERROR: Unable to allocate memory for rb_tree\n");
    }

    // Initialize the empty tree:
    else {
        tree->root = NULL;
        tree->comp = comp;
    }

    return tree;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x97fc
movq %rdi, %rbx
movl $0x10, %edi
callq 0x10d0
movq %rax, %r14
testq %rax, %rax
je 0x97f5
movq $0x0, (%r14)
movq %rbx, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x130c
jmp 0x97ea
leaq 0x49fd(%rip), %rdi      # 0xe200
leaq 0x4a03(%rip), %rsi      # 0xe20d
leaq 0x4eca(%rip), %rcx      # 0xe6db
movl $0x8aa, %edx            # imm = 0x8AA
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: rb_tree_copy
rb_tree *rb_tree_copy(const rb_tree *tree) {

    rb_tree *new_tree = NULL;
    rb_node *pred;
    rb_node *node;
    void    *data;
    
    // Sanity check:
    assert(tree != NULL);
    
    // Create a new tree:
    new_tree = new_rb_tree(tree->comp);
    if (new_tree == NULL) { return NULL; }

    // Go to the smallest element of tree while right-threading your path:
    node = tree->root;
    if (node != NULL) {
        while (node->left != NULL) {
            pred = node->left;
            while (pred->right != NULL) { pred = pred->right; }
            pred->right = node;
            node        = node->left;
        }
    }

    // Insert all data from tree into new_tree:
    while (node != NULL) {

        // insert node->data in new_tree ///////////////////////////////////////
        data = node->data;
        data = rb_tree_insert_max(new_tree, data);
        assert(data == NULL);
        ////////////////////////////////////////////////////////////////////////

        // advance node ////////////////////////////////////////////////////////
        node = node->right;
        if (node != NULL) {
            while (node->left != NULL) {
                pred = node->left;
                while (pred->right != NULL && pred->right != node) {
                    pred = pred->right;
                }
                if (pred->right == NULL) {
                    pred->right = node;
                    node        = node->left;
                } else {
                    pred->right = NULL;
                    break;
                }
            }
        }
        ////////////////////////////////////////////////////////////////////////
    }
    
    // Return the new_tree:
    return new_tree;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x9875
movq %rdi, %r14
movq 0x8(%rdi), %rdi
callq 0x97c1
movq %rax, %rbx
testq %rax, %rax
je 0x98ec
movq (%r14), %rax
testq %rax, %rax
je 0x98ec
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x9894
movq %rcx, %r14
movq %rcx, %rdx
movq %rdx, %rcx
movq 0x10(%rdx), %rdx
testq %rdx, %rdx
jne 0x9857
movq %rax, 0x10(%rcx)
movq 0x8(%r14), %rcx
movq %r14, %rax
testq %rcx, %rcx
jne 0x9851
jmp 0x9897
leaq 0x4a07(%rip), %rdi      # 0xe283
leaq 0x498a(%rip), %rsi      # 0xe20d
leaq 0x4eb9(%rip), %rcx      # 0xe743
movl $0x8c7, %edx            # imm = 0x8C7
callq 0x1080
movq %rax, %r14
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x98f7
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x98ec
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x9894
movq %rcx, %r14
movq %rcx, %rdx
movq %rdx, %rcx
movq 0x10(%rdx), %rdx
testq %rdx, %rdx
je 0x98cb
cmpq %rax, %rdx
jne 0x98ba
testq %rdx, %rdx
jne 0x98e2
movq %rax, 0x10(%rcx)
movq 0x8(%r14), %rcx
movq %r14, %rax
testq %rcx, %rcx
jne 0x98b4
jmp 0x9897
movq $0x0, 0x10(%rcx)
jmp 0x9894
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: rb_tree_min
void *rb_tree_min(const rb_tree *tree) {

    rb_node *node;

    // Sanity check:
    assert(tree != NULL);

    // Trivial case: empty tree
    if (tree->root == NULL) { return NULL; }

    // General case: Find the smallest node
    node = tree->root;
    while (node->left != NULL) { node = node->left; }

    // Return a pointer to the data:
    return node->data;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x9f9d
movq (%rdi), %rax
testq %rax, %rax
je 0x9f99
movq %rax, %rcx
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x9f88
movq (%rcx), %rax
jmp 0x9f9b
xorl %eax, %eax
popq %rcx
retq
leaq 0x42df(%rip), %rdi      # 0xe283
leaq 0x4262(%rip), %rsi      # 0xe20d
leaq 0x48b5(%rip), %rcx      # 0xe867
movl $0xa77, %edx            # imm = 0xA77
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: rb_tree_max
void *rb_tree_max(const rb_tree *tree) {

    rb_node *node;

    // Sanity check:
    assert(tree != NULL);

    // Trivial case: empty tree
    if (tree->root == NULL) { return NULL; }

    // General case: Find the biggest node
    node = tree->root;
    while (node->right != NULL) { node = node->right; }

    // Return a pointer to the data:
    return node->data;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x9fdf
movq (%rdi), %rax
testq %rax, %rax
je 0x9fdb
movq %rax, %rcx
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x9fca
movq (%rcx), %rax
jmp 0x9fdd
xorl %eax, %eax
popq %rcx
retq
leaq 0x429d(%rip), %rdi      # 0xe283
leaq 0x4220(%rip), %rsi      # 0xe20d
leaq 0x4896(%rip), %rcx      # 0xe88a
movl $0xa8c, %edx            # imm = 0xA8C
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: rb_tree_prev
void *rb_tree_prev(const rb_tree *tree, const void *data) {

    rb_node *node;
    rb_node *pred;
    int      comp;

    // Sanity Checks:
    assert(tree != NULL);
    assert(data != NULL);

    // Search:
    pred = NULL;
    node = tree->root;
    while (node != NULL) {

        // Compare data:
        comp = (tree->comp)(data, node->data);

        // Data is smaller:
        if (comp < 0) { node = node->left; }

        // Data is bigger:
        else if (comp > 0) {
            pred = node;
            node = node->right;
        }

        // We have found the node:
        else if (node->left != NULL) {
            pred = node->left;
            while (pred->right != NULL) { pred = pred->right; }
            break;
        } else { break; }
    }

    // Return predecesor:
    if (pred == NULL) { return NULL; }
    return pred->data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xa083
movq %rsi, %rbx
testq %rsi, %rsi
je 0xa0a2
movq %rdi, %r14
movq (%rdi), %r15
testq %r15, %r15
je 0xa058
xorl %r12d, %r12d
movq (%r15), %rsi
movq %rbx, %rdi
callq *0x8(%r14)
testl %eax, %eax
js 0xa03f
movl $0x10, %ecx
movq %r15, %rax
jne 0xa047
jmp 0xa05c
movl $0x8, %ecx
movq %r12, %rax
movq (%r15,%rcx), %r15
movq %rax, %r12
testq %r15, %r15
jne 0xa025
testq %rax, %rax
jne 0xa074
xorl %eax, %eax
jmp 0xa077
movq 0x8(%r15), %rcx
movq %r12, %rax
testq %rcx, %rcx
je 0xa053
movq %rcx, %rax
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0xa068
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x41f9(%rip), %rdi      # 0xe283
leaq 0x417c(%rip), %rsi      # 0xe20d
leaq 0x4815(%rip), %rcx      # 0xe8ad
movl $0xaa5, %edx            # imm = 0xAA5
callq 0x1080
leaq 0x4259(%rip), %rdi      # 0xe302
leaq 0x415d(%rip), %rsi      # 0xe20d
leaq 0x47f6(%rip), %rcx      # 0xe8ad
movl $0xaa6, %edx            # imm = 0xAA6
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: rb_tree_next
void *rb_tree_next(const rb_tree *tree, const void *data) {

    rb_node *node;
    rb_node *succ;
    int      comp;

    // Sanity Checks:
    assert(tree != NULL);
    assert(data != NULL);

    // Search:
    succ = NULL;
    node = tree->root;
    while (node != NULL) {

        // Compare data:
        comp = (tree->comp)(data, node->data);

        // Data is smaller:
        if (comp < 0) {
            succ = node;
            node = node->left;
        }

        // Data is bigger:
        else if (comp > 0) { node = node->right; }

        // We have found the node:
        else if (node->right != NULL) {
            succ = node->right;
            while (succ->left != NULL) { succ = succ->left; }
            break;
        } else { break; }
    }

    // Return succesor:
    if (succ == NULL) { return NULL; }
    return succ->data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xa13f
movq %rsi, %rbx
testq %rsi, %rsi
je 0xa15e
movq %rdi, %r14
movq (%rdi), %r12
testq %r12, %r12
je 0xa116
xorl %r15d, %r15d
movq (%r12), %rsi
movq %rbx, %rdi
callq *0x8(%r14)
testl %eax, %eax
js 0xa100
movl $0x10, %eax
jne 0xa108
jmp 0xa11a
movl $0x8, %eax
movq %r12, %r15
movq (%r12,%rax), %r12
testq %r12, %r12
jne 0xa0e8
testq %r15, %r15
jne 0xa130
xorl %eax, %eax
jmp 0xa133
movq 0x10(%r12), %rax
testq %rax, %rax
je 0xa111
movq %rax, %r15
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0xa124
movq (%r15), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x413d(%rip), %rdi      # 0xe283
leaq 0x40c0(%rip), %rsi      # 0xe20d
leaq 0x478b(%rip), %rcx      # 0xe8df
movl $0xad2, %edx            # imm = 0xAD2
callq 0x1080
leaq 0x419d(%rip), %rdi      # 0xe302
leaq 0x40a1(%rip), %rsi      # 0xe20d
leaq 0x476c(%rip), %rcx      # 0xe8df
movl $0xad3, %edx            # imm = 0xAD3
callq 0x1080