LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/ulossycount.c
// Function: LCU_AddNewGroupAfter
void LCU_AddNewGroupAfter(LCU_type * lcu, LCUITEM *newi, LCUGROUP *oldgroup) {
	LCUGROUP *newgroup;

	// remove item from old group...
	newi->nexting->previousing=newi->previousing;
	newi->previousing->nexting=newi->nexting;
	oldgroup->items=newi->nexting;
	//get new group
	newgroup=lcu->freegroups[lcu->gpt++];
	newgroup->count=oldgroup->count+1; // set count to be one more the prev group
	newgroup->items=newi;
	newgroup->previousg=oldgroup;
	newgroup->nextg=oldgroup->nextg;
	oldgroup->nextg=newgroup;
	if (newgroup->nextg!=NULL) // if there is another group
		newgroup->nextg->previousg=newgroup;
	newi->parentg=newgroup;
	newi->nexting=newi;
	newi->previousing=newi;
}

// Assembly:
movq 0x28(%rsi), %rax
movq 0x30(%rsi), %rcx
movq %rcx, 0x30(%rax)
movq 0x30(%rsi), %rcx
movq %rax, 0x28(%rcx)
movq 0x28(%rsi), %rax
movq %rax, 0x8(%rdx)
movq 0x38(%rdi), %rax
movslq 0x4(%rdi), %rcx
leal 0x1(%rcx), %r8d
movl %r8d, 0x4(%rdi)
movq (%rax,%rcx,8), %rax
movl (%rdx), %ecx
incl %ecx
movl %ecx, (%rax)
movq %rsi, 0x8(%rax)
movq %rdx, 0x10(%rax)
movq 0x18(%rdx), %rcx
movq %rcx, 0x18(%rax)
movq %rax, 0x18(%rdx)
movq 0x18(%rax), %rcx
testq %rcx, %rcx
je 0x2022
movq %rax, 0x10(%rcx)
movq %rax, 0x10(%rsi)
movq %rsi, 0x28(%rsi)
movq %rsi, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/ulossycount.c
// Function: LCU_IncrementCounter
void LCU_IncrementCounter(LCU_type * lcu, LCUITEM *newi)
{
	LCUGROUP *oldgroup;

	oldgroup=newi->parentg;
	if ((oldgroup->nextg!=NULL) && 
		(oldgroup->nextg->count - oldgroup->count==1))
		LCU_PutInNewGroup(lcu, newi,oldgroup->nextg);
	// if the next group exists
	else { // need to create a new group with a differential of one
		if (newi->nexting==newi) // if there is only one item in the group...
			newi->parentg->count++;
		else      
			LCU_AddNewGroupAfter(lcu,newi,oldgroup);
	}
}

// Assembly:
movq 0x10(%rsi), %rdx
movq 0x18(%rdx), %rax
testq %rax, %rax
je 0x204d
movl (%rax), %ecx
subl (%rdx), %ecx
cmpl $0x1, %ecx
jne 0x204d
movq %rax, %rdx
jmp 0x1f42
cmpq %rsi, 0x28(%rsi)
je 0x2058
jmp 0x1fcb
incl (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/ulossycount.c
// Function: LCU_Update
void LCU_Update(LCU_type * lcu, LCLitem_t newitem) {
	int h;
	LCUITEM *il;

	lcu->n++;
	h=hash31(lcu->a,lcu->b,newitem) % lcu->tblsz;
	il=lcu->hashtable[h];
	while (il) {
		if (il->item == newitem) 
			break;
		il=il->nexti;
	}
	if (il==NULL) // item is not monitored (not in hashtable) 
	{
		il=LCU_GetNewCounter(lcu);
		/// and put it into the hashtable for the new item 
		il->delta=lcu->root->count;
		// initialize delta with count of first group
		LCU_InsertIntoHashtable(lcu,il,h,newitem);
		// put the new counter into the first group
		// counter is already in first group by defn of how we got it
		LCU_IncrementCounter(lcu, il);
	}
	else 
		LCU_IncrementCounter(lcu, il);
	// if we have an item, we need to increment its counter 
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
incl (%rdi)
movl %esi, %ebp
movq 0x10(%rdi), %rdi
movq 0x18(%rbx), %rsi
movl %ebp, %edx
callq 0x253f
movslq 0xc(%rbx), %rcx
cqto
idivq %rcx
movq %rdx, %r14
movq 0x40(%rbx), %rax
movq (%rax,%rdx,8), %rsi
testq %rsi, %rsi
je 0x2098
cmpl %ebp, (%rsi)
je 0x20d7
movq 0x20(%rsi), %rsi
jmp 0x2089
movq %rbx, %rdi
callq 0x1ef1
movq %rax, %rsi
movq 0x20(%rbx), %rax
movl (%rax), %eax
movl %eax, 0x8(%rsi)
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rcx
movq %rcx, 0x20(%rsi)
movl %ebp, (%rsi)
movl %r14d, 0x4(%rsi)
movq $0x0, 0x18(%rsi)
movq (%rax,%r14,8), %rcx
testq %rcx, %rcx
je 0x20d3
movq %rsi, 0x18(%rcx)
movq %rsi, (%rax,%r14,8)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x202f
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/ulossycount.c
// Function: LCU_Destroy
void LCU_Destroy(LCU_type * lcu)
{
	free(lcu->freegroups);
	free(lcu->items);
	free(lcu->groups);
	free(lcu->hashtable);
	free (lcu);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
callq 0x1050
movq 0x28(%rbx), %rdi
callq 0x1050
movq 0x30(%rbx), %rdi
callq 0x1050
movq 0x40(%rbx), %rdi
callq 0x1050
movq %rbx, %rdi
popq %rbx
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/ulossycount.c
// Function: LCU_PointEstUpp
int LCU_PointEstUpp(LCU_type * lcu, LCLitem_t newitem) {
	int h;
	LCUITEM *il;

	lcu->n++;
	h=hash31(lcu->a,lcu->b,newitem) % lcu->tblsz;
	il=lcu->hashtable[h];
	while (il) {
		if (il->item == newitem) 
			return il->parentg->count;
		il=il->nexti;
	}
	return (lcu->root != NULL ? lcu->root->count : 0);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
incl (%rdi)
movl %esi, %ebp
movq 0x10(%rdi), %rdi
movq 0x18(%rbx), %rsi
movl %ebp, %edx
callq 0x253f
movslq 0xc(%rbx), %rcx
cqto
idivq %rcx
movq 0x40(%rbx), %rax
movq (%rax,%rdx,8), %rax
testq %rax, %rax
je 0x2160
cmpl %ebp, (%rax)
je 0x216d
movq 0x20(%rax), %rax
jmp 0x2151
movq 0x20(%rbx), %rax
testq %rax, %rax
jne 0x2171
xorl %eax, %eax
jmp 0x2173
movq 0x10(%rax), %rax
movl (%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/ulossycount.c
// Function: LCU_PointEstLow
int LCU_PointEstLow(LCU_type * lcu, LCLitem_t newitem) {
	int h;
	LCUITEM *il;

	lcu->n++;
	h=hash31(lcu->a,lcu->b,newitem) % lcu->tblsz;
	il=lcu->hashtable[h];
	while (il) {
		if (il->item == newitem) 
			return thismax(il->parentg->count - il->delta, 0);
		il=il->nexti;
	}
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
incl (%rdi)
movl %esi, %ebx
movq 0x10(%rdi), %rdi
movq 0x18(%r14), %rsi
movl %ebx, %edx
callq 0x253f
movslq 0xc(%r14), %rcx
cqto
idivq %rcx
movq 0x40(%r14), %rax
movq (%rax,%rdx,8), %rax
testq %rax, %rax
je 0x21bc
cmpl %ebx, (%rax)
je 0x21c0
movq 0x20(%rax), %rax
jmp 0x21ad
xorl %eax, %eax
jmp 0x21d0
movq 0x10(%rax), %rcx
movl (%rcx), %ecx
subl 0x8(%rax), %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovgl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/hashtable.c
// Function: HT_Clear
void HT_Clear(LL ** hashtable, int size) { //destroy
	int i;
	LL * ptr, * tmp;
	for (i = 0; i < size; i++) {
		ptr = hashtable[i];
		hashtable[i] = NULL;
		while (ptr) {
			tmp = ptr->next;
			free(ptr);
			ptr = tmp;
		}
	}
	free(hashtable);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
jle 0x2224
movl %esi, %r14d
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdi
movq $0x0, (%rbx,%r15,8)
testq %rdi, %rdi
je 0x221c
movq 0x10(%rdi), %r12
callq 0x1050
movq %r12, %rdi
testq %r12, %r12
jne 0x220b
incq %r15
cmpq %r14, %r15
jne 0x21fa
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/hashtable.c
// Function: HT_Insert
LL * HT_Insert(LL ** hashtable, int64__t item, int val, int size) { //if item already exists just return the pointer, otherwise insert and set val
	int hash = (int) hash31(HASHA_VAL, HASHB_VAL, item) % size;

	//ptr is the start of the list
	LL * ptr = hashtable[hash];

	//search thru the list
	while (ptr) {
		if (ptr->item == item) return ptr; //if we have found it, we are done
		ptr = ptr->next; //keep looking
	}
	
	//if we get here then ptr = NULL and we aren't in the list yet so we may prepend it to the list
	ptr = (LL*) calloc(1, sizeof(LL));
	ptr->item = item;
	ptr->val = val;
	ptr->next = hashtable[hash];
	ptr->prev = NULL;
	if (hashtable[hash] != NULL) hashtable[hash]->prev = ptr;
	hashtable[hash] = ptr;
	return ptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x9041077, %edi        # imm = 0x9041077
movl $0x66939d, %esi         # imm = 0x66939D
movq %r14, %rdx
callq 0x253f
cltd
idivl %r15d
movslq %edx, %r15
movq (%rbx,%r15,8), %rax
testq %rax, %rax
je 0x2276
cmpq %r14, (%rax)
je 0x22a8
movq 0x10(%rax), %rax
jmp 0x2266
movl $0x1, %edi
movl $0x20, %esi
callq 0x1120
movq %r14, (%rax)
movl %ebp, 0x8(%rax)
movq (%rbx,%r15,8), %rcx
movq %rcx, 0x10(%rax)
movq $0x0, 0x18(%rax)
testq %rcx, %rcx
je 0x22a4
movq %rax, 0x18(%rcx)
movq %rax, (%rbx,%r15,8)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/hashtable.c
// Function: HT_Find
LL * HT_Find(LL ** hashtable, int64__t item, int size) { //find the LL corresponding to the item. All updates happen via this, as do removes
	int hash = (int) hash31(HASHA_VAL, HASHB_VAL, item) % size;

	//ptr is the start of the list
	LL * ptr = hashtable[hash];

	//search thru the list
	while (ptr) {
		if (ptr->item == item) return ptr; //if we have found it, we are done
		ptr = ptr->next; //keep looking
	}
	//can't find
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movl $0x9041077, %edi        # imm = 0x9041077
movl $0x66939d, %esi         # imm = 0x66939D
movq %rbx, %rdx
callq 0x253f
cltd
idivl %ebp
movslq %edx, %rax
movq (%r14,%rax,8), %rax
testq %rax, %rax
je 0x22eb
cmpq %rbx, (%rax)
je 0x22ed
movq 0x10(%rax), %rax
jmp 0x22db
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: LLMedSelect
int64__t LLMedSelect(int k, int n, int64__t arr[]) {
  int64__t a, temp;

  int i, ir, j, mid, l;

  l=1;
  ir=n;
  for (;;) {
    if (ir <= l+1) {
      if (ir == l+1 && arr[ir] < arr[l]) {
	SWAP(arr[l],arr[ir])
	  }
      return arr[k];
    }
    else
      {
	mid=(l+ir) >> 1;
	SWAP(arr[mid],arr[l+1])
	  if (arr[l] > arr[ir]) {
	    SWAP(arr[l],arr[ir])
	      }
	if (arr[l+1] > arr[ir]) {
	  SWAP(arr[l+1],arr[ir])
	    }
	if (arr[l] > arr[l+1]) {
	  SWAP(arr[l],arr[l+1])
	    }
	i=l+1;
	j=ir;
	a=arr[l+1];
	for (;;) {
	  do i++; while (arr[i] < a);
	  do j--; while (arr[j] > a);
	  if (j < i) break;
	  SWAP(arr[i],arr[j])
	    }
	arr[l+1]=arr[j];
	arr[j]=a;
	if (j >= k) ir=j-1;
	if (j <= k) l=i;
      }
  }

    }

// Assembly:
cmpl $0x3, %esi
jl 0x2405
pushq %r14
pushq %rbx
movl $0x1, %ecx
movl $0x2, %eax
leal (%rcx,%rsi), %r8d
sarl %r8d
movslq %r8d, %r9
movq (%rdx,%r9,8), %r10
movslq %eax, %r8
movq (%rdx,%r8,8), %r11
movq %r11, (%rdx,%r9,8)
movq %r10, (%rdx,%r8,8)
movslq %ecx, %r9
movq (%rdx,%r9,8), %r11
movslq %esi, %r10
movq (%rdx,%r10,8), %rbx
cmpq %rbx, %r11
jle 0x236e
movq %rbx, (%rdx,%r9,8)
movq %r11, (%rdx,%r10,8)
movq (%rdx,%r8,8), %r11
movq (%rdx,%r10,8), %rbx
cmpq %rbx, %r11
jle 0x2383
movq %rbx, (%rdx,%r8,8)
movq %r11, (%rdx,%r10,8)
movq (%rdx,%r9,8), %r10
movq (%rdx,%r8,8), %r11
cmpq %r11, %r10
jle 0x2398
movq %r11, (%rdx,%r9,8)
movq %r10, (%rdx,%r8,8)
movq (%rdx,%r8,8), %r10
movl %esi, %r9d
cltq
movq 0x8(%rdx,%rax,8), %r11
incq %rax
cmpq %r10, %r11
jl 0x23a1
movslq %r9d, %rbx
incq %rbx
movq -0x10(%rdx,%rbx,8), %r14
decl %r9d
decq %rbx
cmpq %r10, %r14
jg 0x23b4
cmpq %rax, %rbx
jle 0x23d4
movq %r14, (%rdx,%rax,8)
movq %r11, -0x8(%rdx,%rbx,8)
jmp 0x239f
leal 0x1(%r9), %r11d
movq %r14, (%rdx,%r8,8)
movq %r10, -0x8(%rdx,%rbx,8)
leal -0x1(%r9), %r8d
cmpl %edi, %r11d
cmovgl %r8d, %esi
cmpl %edi, %r9d
cmovlel %eax, %ecx
leal 0x1(%rcx), %eax
cmpl %eax, %esi
jg 0x2336
movslq %ecx, %rcx
popq %rbx
popq %r14
jmp 0x240f
movl $0x2, %eax
movl $0x1, %ecx
cmpl %eax, %esi
jne 0x242b
movslq %esi, %rax
movq (%rdx,%rax,8), %rsi
movq (%rdx,%rcx,8), %r8
cmpq %r8, %rsi
jge 0x242b
movq %rsi, (%rdx,%rcx,8)
movq %r8, (%rdx,%rax,8)
movslq %edi, %rax
movq (%rdx,%rax,8), %rax
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: MedSelect
int MedSelect(int k, int n, int arr[]) {
  int a, temp;

  int i, ir, j, mid, l;

  l=1;
  ir=n;
  for (;;) {
    if (ir <= l+1) {
      if (ir == l+1 && arr[ir] < arr[l]) {
	SWAP(arr[l],arr[ir])
	  }
      return arr[k];
    }
    else
      {
	mid=(l+ir) >> 1;
	SWAP(arr[mid],arr[l+1])
	  if (arr[l] > arr[ir]) {
	    SWAP(arr[l],arr[ir])
	      }
	if (arr[l+1] > arr[ir]) {
	  SWAP(arr[l+1],arr[ir])
	    }
	if (arr[l] > arr[l+1]) {
	  SWAP(arr[l],arr[l+1])
	    }
	i=l+1;
	j=ir;
	a=arr[l+1];
	for (;;) {
	  do i++; while (arr[i] < a);
	  do j--; while (arr[j] > a);
	  if (j < i) break;
	  SWAP(arr[i],arr[j])
	    }
	arr[l+1]=arr[j];
	arr[j]=a;
	if (j >= k) ir=j-1;
	if (j <= k) l=i;
      }
  }
}

// Assembly:
cmpl $0x3, %esi
jl 0x2514
pushq %rbp
pushq %rbx
movl $0x1, %ecx
movl $0x2, %eax
leal (%rcx,%rsi), %r8d
sarl %r8d
movslq %r8d, %r9
movl (%rdx,%r9,4), %r10d
movslq %eax, %r8
movl (%rdx,%r8,4), %r11d
movl %r11d, (%rdx,%r9,4)
movl %r10d, (%rdx,%r8,4)
movslq %ecx, %r9
movl (%rdx,%r9,4), %r11d
movslq %esi, %r10
movl (%rdx,%r10,4), %ebx
cmpl %ebx, %r11d
jle 0x2480
movl %ebx, (%rdx,%r9,4)
movl %r11d, (%rdx,%r10,4)
movl (%rdx,%r8,4), %r11d
movl (%rdx,%r10,4), %ebx
cmpl %ebx, %r11d
jle 0x2495
movl %ebx, (%rdx,%r8,4)
movl %r11d, (%rdx,%r10,4)
movl (%rdx,%r9,4), %r10d
movl (%rdx,%r8,4), %r11d
cmpl %r11d, %r10d
jle 0x24aa
movl %r11d, (%rdx,%r9,4)
movl %r10d, (%rdx,%r8,4)
movl (%rdx,%r8,4), %r10d
movl %esi, %r9d
cltq
movl 0x4(%rdx,%rax,4), %r11d
incq %rax
cmpl %r10d, %r11d
jl 0x24b3
movslq %r9d, %rbx
incq %rbx
movl -0x8(%rdx,%rbx,4), %ebp
decl %r9d
decq %rbx
cmpl %r10d, %ebp
jg 0x24c6
cmpq %rax, %rbx
jle 0x24e4
movl %ebp, (%rdx,%rax,4)
movl %r11d, -0x4(%rdx,%rbx,4)
jmp 0x24b1
leal 0x1(%r9), %r11d
movl %ebp, (%rdx,%r8,4)
movl %r10d, -0x4(%rdx,%rbx,4)
leal -0x1(%r9), %r8d
cmpl %edi, %r11d
cmovgl %r8d, %esi
cmpl %edi, %r9d
cmovlel %eax, %ecx
leal 0x1(%rcx), %eax
cmpl %eax, %esi
jg 0x2448
movslq %ecx, %rcx
popq %rbx
popq %rbp
jmp 0x251e
movl $0x2, %eax
movl $0x1, %ecx
cmpl %eax, %esi
jne 0x2538
movslq %esi, %rax
movl (%rdx,%rax,4), %esi
movl (%rdx,%rcx,4), %r8d
cmpl %r8d, %esi
jge 0x2538
movl %esi, (%rdx,%rcx,4)
movl %r8d, (%rdx,%rax,4)
movslq %edi, %rax
movl (%rdx,%rax,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: fourwise
long hash31(int64__t a, int64__t b, int64__t x)
{

  int64__t result;
  long lresult;

  // return a hash of x using a and b mod (2^31 - 1)
// may need to do another mod afterwards, or drop high bits
// depending on d, number of bad guys
// 2^31 - 1 = 2147483647

  //  result = ((int64__t) a)*((int64__t) x)+((int64__t) b);
  result=(a * x) + b;
  result = ((result >> HL) + result) & MOD;
  lresult=(long) result;

  return(lresult);
}

// Assembly:
imulq %r8, %rdi
leaq (%rdi,%rsi), %rax
movq %rax, %rsi
shrq $0x1f, %rsi
addl %eax, %esi
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %esi
imulq %r8, %rsi
addq %rdx, %rsi
movq %rsi, %rdx
shrq $0x1f, %rdx
addl %esi, %edx
andl %edi, %edx
imulq %r8, %rdx
addq %rcx, %rdx
movq %rdx, %rax
shrq $0x1f, %rax
addl %edx, %eax
andl %edi, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: ran1
float ran1(prng_type * prng) {

  // A Random Number Generator that picks a uniform [0,1] random number
  // From Numerical Recipes, page 280
  // Should be called with a NEGATIVE value of idum to initialize
  // subsequent calls should not alter idum

  int j;
  long k;
  float temp;

  if (prng->floatidum <= 0 || !prng->iy) {
    if (-(prng->floatidum) < 1) prng->floatidum=1;
    else prng->floatidum = -(prng->floatidum);
    for (j=NTAB+7;j>=0;j--) {
      k=(prng->floatidum)/IQ;
      prng->floatidum=IA*(prng->floatidum-k*IQ)-IR*k;
      if (prng->floatidum < 0) prng->floatidum+=IM;
      if (j<NTAB) prng->iv[j]=prng->floatidum;
    }
    prng->iy=prng->iv[0];
  }
  k = (prng->floatidum)/IQ;
  prng->floatidum=IA*(prng->floatidum-k*IQ)-IR*k;
  if (prng->floatidum<0) prng->floatidum += IM;
  j = prng->iy/NDIV;
  prng->iy=prng->iv[j];
  prng->iv[j]=prng->floatidum;
  if ((temp=AM*prng->iy) > RNMX) return RNMX;
  else return temp;
}

// Assembly:
movq 0x8(%rdi), %rax
movabsq $0x41a705af1fe3fb79, %rsi # imm = 0x41A705AF1FE3FB79
testq %rax, %rax
jle 0x25ad
cmpq $0x0, 0x18(%rdi)
jne 0x2624
movq %rax, %rdx
negq %rdx
testq %rax, %rax
movl $0x1, %ecx
cmovsq %rdx, %rcx
movq %rcx, 0x8(%rdi)
movl $0x27, %r8d
movq %rcx, %rax
imulq %rsi
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xf, %rdx
addq %rax, %rdx
imulq $-0x1f31d, %rdx, %rax   # imm = 0xFFFE0CE3
addq %rcx, %rax
imulq $0x41a7, %rax, %rax     # imm = 0x41A7
imulq $-0xb14, %rdx, %rdx     # imm = 0xF4EC
leaq (%rax,%rdx), %rcx
addq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
addq %rdx, %rax
cmovnsq %rax, %rcx
cmpq $0x1f, %r8
ja 0x2612
movq %rcx, 0x20(%rdi,%r8,8)
addq $-0x1, %r8
jb 0x25c9
movq %rcx, 0x8(%rdi)
movq 0x20(%rdi), %rax
movq %rax, 0x18(%rdi)
movq 0x8(%rdi), %rcx
movq 0x18(%rdi), %r8
movq %rcx, %rax
imulq %rsi
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xf, %rdx
addq %rax, %rdx
imulq $-0x1f31d, %rdx, %rax   # imm = 0xFFFE0CE3
addq %rcx, %rax
imulq $0x41a7, %rax, %rax     # imm = 0x41A7
imulq $-0xb14, %rdx, %rcx     # imm = 0xF4EC
leaq (%rax,%rcx), %rdx
addq $0x7fffffff, %rdx       # imm = 0x7FFFFFFF
addq %rcx, %rax
cmovnsq %rax, %rdx
leaq 0x3ffffff(%r8), %rax
testq %r8, %r8
cmovnsq %r8, %rax
movq %rdx, 0x8(%rdi)
shrq $0x1a, %rax
cltq
movq 0x20(%rdi,%rax,8), %rcx
movq %rcx, 0x18(%rdi)
movq %rdx, 0x20(%rdi,%rax,8)
cvtsi2sdq 0x18(%rdi), %xmm0
mulsd 0x1b12(%rip), %xmm0     # 0x41b0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm1
ucomisd 0x1b0a(%rip), %xmm1     # 0x41b8
jbe 0x26b8
movss 0x1b38(%rip), %xmm0     # 0x41f0
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: ran2
long ran2(prng_type * prng) {

  // A Random Number Generator that picks a uniform random number
  // from the range of long integers.
  // From Numerical Recipes, page 280
  // Should be called with a NEGATIVE value of idum to initialize
  // subsequent calls should not alter idum
  // This is a hacked version of the above procedure, so proceed with
  // caution.

  int j;
  long k;

  if (prng->intidum <= 0 || !prng->iy) {
    if (-(prng->intidum) < 1) prng->intidum=1;
    else prng->intidum = -(prng->intidum);
    for (j=NTAB+7;j>=0;j--) {
      k=(prng->intidum)/IQ;
      prng->intidum=IA*(prng->intidum-k*IQ)-IR*k;
      if (prng->intidum < 0) prng->intidum+=IM;
      if (j<NTAB) prng->iv[j]=prng->intidum;
    }
    prng->iy=prng->iv[0];
  }
  k = (prng->intidum)/IQ;
  prng->intidum=IA*(prng->intidum-k*IQ)-IR*k;
  if (prng->intidum<0) prng->intidum += IM;
  j = prng->iy/NDIV;
  prng->iy=prng->iv[j];
  prng->iv[j]=prng->intidum;
  return prng->iy;
}

// Assembly:
movq 0x10(%rdi), %rax
movabsq $0x41a705af1fe3fb79, %rsi # imm = 0x41A705AF1FE3FB79
testq %rax, %rax
jle 0x26d3
cmpq $0x0, 0x18(%rdi)
jne 0x274a
movq %rax, %rdx
negq %rdx
testq %rax, %rax
movl $0x1, %ecx
cmovsq %rdx, %rcx
movq %rcx, 0x10(%rdi)
movl $0x27, %r8d
movq %rcx, %rax
imulq %rsi
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xf, %rdx
addq %rax, %rdx
imulq $-0x1f31d, %rdx, %rax   # imm = 0xFFFE0CE3
addq %rcx, %rax
imulq $0x41a7, %rax, %rax     # imm = 0x41A7
imulq $-0xb14, %rdx, %rdx     # imm = 0xF4EC
leaq (%rax,%rdx), %rcx
addq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
addq %rdx, %rax
cmovnsq %rax, %rcx
cmpq $0x1f, %r8
ja 0x2738
movq %rcx, 0x20(%rdi,%r8,8)
addq $-0x1, %r8
jb 0x26ef
movq %rcx, 0x10(%rdi)
movq 0x20(%rdi), %rax
movq %rax, 0x18(%rdi)
movq 0x10(%rdi), %rcx
movq 0x18(%rdi), %r8
movq %rcx, %rax
imulq %rsi
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xf, %rdx
addq %rax, %rdx
imulq $-0x1f31d, %rdx, %rax   # imm = 0xFFFE0CE3
addq %rcx, %rax
imulq $0x41a7, %rax, %rax     # imm = 0x41A7
imulq $-0xb14, %rdx, %rcx     # imm = 0xF4EC
leaq (%rax,%rcx), %rdx
addq $0x7fffffff, %rdx       # imm = 0x7FFFFFFF
addq %rcx, %rax
cmovnsq %rax, %rdx
leaq 0x3ffffff(%r8), %rax
testq %r8, %r8
cmovnsq %r8, %rax
movq %rdx, 0x10(%rdi)
shrq $0x1a, %rax
cltq
movq 0x20(%rdi,%rax,8), %rcx
movq %rcx, 0x18(%rdi)
movq %rdx, 0x20(%rdi,%rax,8)
movq 0x18(%rdi), %rax
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: ran3
unsigned long ran3(prng_type * prng) {

  unsigned long x;

  /* generate next random number */

  x = prng->randbuffer[prng->r_p1] = rotl(prng->randbuffer[prng->r_p2], R1)
    +  rotl(prng->randbuffer[prng->r_p1], R2);
  /* rotate list pointers */
  if (--prng->r_p1 < 0) prng->r_p1 = KK - 1;
  if (--prng->r_p2 < 0) prng->r_p2 = KK - 1;
  /* conversion to float */
  return x;
}

// Assembly:
movq 0x1a8(%rdi), %rax
movq %rax, %xmm0
movq %rax, %rcx
sarq $0x20, %rcx
movq 0x120(%rdi,%rcx,8), %rcx
rolq $0x5, %rcx
movslq %eax, %rdx
movq 0x120(%rdi,%rdx,8), %rax
rolq $0x3, %rax
addq %rcx, %rax
pcmpeqd %xmm1, %xmm1
paddd %xmm0, %xmm1
pxor %xmm2, %xmm2
pcmpgtd %xmm2, %xmm0
pand %xmm0, %xmm1
pandn 0x19ee(%rip), %xmm0     # 0x4200
movq %rax, 0x120(%rdi,%rdx,8)
por %xmm1, %xmm0
movq %xmm0, 0x1a8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: RanrotAInit
void RanrotAInit (prng_type * prng, unsigned long seed) {

  int i;

  /* put semi-random numbers into the buffer */
  for (i=0; i<KK; i++) {
    prng->randbuffer[i] = seed;
    seed = rotl(seed,5) + 97;}

  /* initialize pointers to circular buffer */
  prng->r_p1 = 0;  prng->r_p2 = JJ;

  /* randomize */
  for (i = 0;  i < 300;  i++) ran3(prng);
  prng->scale = ldexp(1.0f, -8.0f * sizeof(unsigned long));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movq %rsi, 0x120(%rbx,%rax,8)
rolq $0x5, %rsi
addq $0x61, %rsi
incq %rax
cmpq $0x11, %rax
jne 0x28bc
movabsq $0xa00000000, %rax      # imm = 0xA00000000
movq %rax, 0x1a8(%rbx)
xorl %edx, %edx
movl $0xa, %esi
movl $0x12c, %eax            # imm = 0x12C
movl $0x10, %ecx
movslq %esi, %rdi
movq 0x120(%rbx,%rdi,8), %rsi
rolq $0x5, %rsi
movslq %edx, %r8
movq 0x120(%rbx,%r8,8), %rdx
rolq $0x3, %rdx
addq %rsi, %rdx
movq %rdx, 0x120(%rbx,%r8,8)
leal -0x1(%r8), %edx
testl %r8d, %r8d
cmovlel %ecx, %edx
leal -0x1(%rdi), %esi
testl %edi, %edi
cmovlel %ecx, %esi
decl %eax
jne 0x28f7
movl %esi, 0x1ac(%rbx)
movl %edx, 0x1a8(%rbx)
movsd 0x16be(%rip), %xmm0     # 0x4008
movl $0xffffffc0, %edi       # imm = 0xFFFFFFC0
callq 0x1060
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: prng_int
long prng_int(prng_type * prng) {

  // returns a pseudo-random long integer.  Initialise the generator
  // before use!

  long response=0;

  switch (prng->usenric)
    {
    case 1 : response=(ran2(prng)); break;
    case 2 : response=(ran3(prng)); break;
    case 3 : response=(lrand48()); break;
    }
  return response;
}

// Assembly:
movl (%rdi), %eax
cmpl $0x3, %eax
je 0x1160
cmpl $0x2, %eax
je 0x297b
cmpl $0x1, %eax
je 0x26b9
xorl %eax, %eax
retq
movq 0x1a8(%rdi), %rcx
movq %rcx, %rax
sarq $0x20, %rax
movq 0x120(%rdi,%rax,8), %rdx
rolq $0x5, %rdx
movslq %ecx, %rsi
movq 0x120(%rdi,%rsi,8), %rax
rolq $0x3, %rax
movq %rcx, %xmm0
addq %rdx, %rax
movq %rax, 0x120(%rdi,%rsi,8)
pcmpeqd %xmm1, %xmm1
paddd %xmm0, %xmm1
pxor %xmm2, %xmm2
pcmpgtd %xmm2, %xmm0
pand %xmm0, %xmm1
pandn 0x1830(%rip), %xmm0     # 0x4200
por %xmm1, %xmm0
movq %xmm0, 0x1a8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: prng_float
float prng_float(prng_type * prng) {

  // returns a pseudo-random float in the range [0.0,1.0].
  // Initialise the generator before use!
  float result=0;

  switch (prng->usenric)
    {
    case 1 : result=(ran1(prng)); break;
    case 2 : result=(ran4(prng)); break;
    case 3 : result=(drand48()); break;
    }
  return result;
}

// Assembly:
movl (%rdi), %eax
cmpl $0x3, %eax
je 0x2a6b
cmpl $0x2, %eax
je 0x29fe
xorps %xmm0, %xmm0
cmpl $0x1, %eax
jne 0x2a79
jmp 0x2593
movq 0x1a8(%rdi), %rcx
movq %rcx, %rax
sarq $0x20, %rax
movq 0x120(%rdi,%rax,8), %rdx
rolq $0x5, %rdx
movslq %ecx, %rsi
movq 0x120(%rdi,%rsi,8), %rax
rolq $0x3, %rax
movq %rcx, %xmm0
addq %rdx, %rax
movq %rax, 0x120(%rdi,%rsi,8)
pcmpeqd %xmm1, %xmm1
paddd %xmm0, %xmm1
pxor %xmm2, %xmm2
pcmpgtd %xmm2, %xmm0
pand %xmm0, %xmm1
pandn 0x17ad(%rip), %xmm0     # 0x4200
por %xmm1, %xmm0
movq %xmm0, 0x1a8(%rdi)
js 0x2a7a
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x2a92
pushq %rax
callq 0x1200
cvtsd2ss %xmm0, %xmm0
addq $0x8, %rsp
retq
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
mulss 0x4(%rdi), %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: prng_Init
prng_type * prng_Init(long seed, int nric) {

  // Initialise the random number generators.  nric determines
  // which algorithm to use, 1 for Numerical Recipes in C,
  // 0 for the other one.
  prng_type * result;

  result=(prng_type *) calloc(1,sizeof(prng_type));

  result->iy=0;
  result->usenric=nric;
  result->floatidum=-1;
  result->intidum=-1;
  result->iset=0;
  // set a global variable to record which algorithm to use
  switch (nric)
    {
    case 2 :
      RanrotAInit(result,seed);
      break;
    case 1 :
      if (seed>0) {
	// to initialise the NRiC PRNGs, call it with a negative value
	// so make sure it gets a negative value!
	result->floatidum = -(seed);  result->intidum = -(seed);
      } else {
	result->floatidum=seed; result->intidum=seed;
      }
      break;
    case 3 :
      srand48(seed);
      break;
    }

  prng_float(result);
  prng_int(result);
  // call the routines to actually initialise them
  return(result);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x1, %edi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x1120
movq %rax, %rbx
movq $0x0, 0x18(%rax)
movl %ebp, (%rax)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x8(%rax)
movl $0x0, 0x1b0(%rax)
cmpl $0x1, %ebp
je 0x2af6
cmpl $0x3, %ebp
je 0x2aec
cmpl $0x2, %ebp
jne 0x2b06
movq %rbx, %rdi
movq %r14, %rsi
callq 0x28b6
jmp 0x2b06
movq %r14, %rdi
callq 0x1180
jmp 0x2b06
testq %r14, %r14
jle 0x2afe
negq %r14
movq %r14, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movq %rbx, %rdi
callq 0x29dd
movq %rbx, %rdi
callq 0x295f
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: prng_normal
double prng_normal(prng_type * prng) {

  // Pick random values distributed N(0,1) using the Box-Muller transform
  // Taken from numerical recipes in C p289
  // picks two at a time, returns one per call (buffers the other)

  double fac,rsq,v1,v2;
  if (prng->iset == 0) {
    do {
      v1 = 2.0*prng_float(prng)-1.0;
      v2 = 2.0*prng_float(prng)-1.0;
      rsq=v1*v1+v2*v2;
    } while (rsq >= 1.0 || rsq == 0.0);

    fac = sqrt((double) -2.0*log((double)rsq)/rsq);
    prng->gset=v1*fac;
    prng->iset=1;
    return v2*fac;
  }
  else {
    prng->iset = 0;
    return prng->gset;
  }
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x1b0(%rdi)
je 0x2b7a
movl $0x0, 0x1b0(%rbx)
movsd 0x1b8(%rbx), %xmm1
jmp 0x2c40
movq %rbx, %rdi
callq 0x29dd
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
addsd %xmm1, %xmm1
movsd 0x14cb(%rip), %xmm0     # 0x4060
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq %rbx, %rdi
callq 0x29dd
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
addsd %xmm1, %xmm1
addsd 0x14a6(%rip), %xmm1     # 0x4060
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
movsd 0x8(%rsp), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm2, %xmm0
ucomisd 0x1430(%rip), %xmm0     # 0x4008
jae 0x2b7a
ucomisd 0x143e(%rip), %xmm0     # 0x4020
jne 0x2be6
jnp 0x2b7a
movsd %xmm1, 0x18(%rsp)
movsd %xmm0, 0x10(%rsp)
callq 0x10e0
mulsd 0x15c1(%rip), %xmm0     # 0x41c0
divsd 0x10(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2c15
sqrtsd %xmm0, %xmm0
jmp 0x2c1a
callq 0x11d0
movsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x1b8(%rbx)
movl $0x1, 0x1b0(%rbx)
movsd 0x18(%rsp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: prng_stabledbn
double prng_stabledbn(prng_type * prng, double alpha) {

  // From 'stable distributions', John Nolan, manuscript, p24
  // we set beta = 0 by analogy with the normal and cauchy case
  // identical to the above routine, but returns a double instead
  // of a long double (you'll see this a lot...)

  double theta, W, holder, left, right;

  theta=PI*(prng_float(prng) - 0.5);
  W = -log(prng_float(prng)); // takes natural log

  //  printf("theta %Lf, W = %Lf \n", theta, W);

  // some notes on Nolan's notes:
  // if beta == 0 then c(alpha,beta)=1; theta_0 = 0
  // expression reduces to sin alpha.theta / (cos theta) ^1/alpha
  //  * (cos (theta - alpha theta)/W) ^(1-alpha)/alpha
  left = (sin(alpha*theta)/pow(cos(theta), 1.0/alpha));
  right= pow(cos(theta*(1.0 - alpha))/W, ((1.0-alpha)/alpha));
  holder=left*right;
  return(holder);
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movsd %xmm0, (%rsp)
movq %rdi, %rbx
callq 0x29dd
cvtss2sd %xmm0, %xmm0
addsd 0x1560(%rip), %xmm0     # 0x41c8
mulsd 0x1560(%rip), %xmm0     # 0x41d0
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
callq 0x29dd
cvtss2sd %xmm0, %xmm0
callq 0x10e0
xorps 0x1582(%rip), %xmm0     # 0x4210
movaps %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd (%rsp), %xmm0
callq 0x11a0
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x10f0
movsd 0x134c(%rip), %xmm1     # 0x4008
divsd (%rsp), %xmm1
callq 0x1090
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x132a(%rip), %xmm1     # 0x4008
subsd (%rsp), %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
callq 0x10f0
divsd 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
divsd (%rsp), %xmm1
callq 0x1090
mulsd 0x8(%rsp), %xmm0
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: prng_altstab
double prng_altstab(prng_type * prng, double p)
{
  double u,v,result;

  u=prng_float(prng);
  v=prng_float(prng);
  result=pow(u,p);
  // result=exp(p*log(u));
  if (v<0.5) result=-result;
  return(result);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movsd %xmm0, 0x18(%rsp)
movq %rdi, %rbx
callq 0x29dd
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
callq 0x29dd
movss %xmm0, 0xc(%rsp)
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0x1090
movss 0x146d(%rip), %xmm1     # 0x41f4
ucomiss 0xc(%rsp), %xmm1
jbe 0x2d95
xorps 0x147b(%rip), %xmm0     # 0x4210
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: prng_stable
double prng_stable(prng_type * prng, double alpha) {

  // wrapper for the stable distributions above:
  // call the appropriate routine based on the value of alpha given
  // initialising it with the seed in idum

  // randinit must be called before entering this procedure for
  // the first time since it uses the random generators


  if (alpha==2.0)
    return(prng_normal(prng));
  else if (alpha==1.0)
    return(prng_cauchy(prng));
  else if (alpha<0.01)
    return(prng_altstab(prng,-50.0));
  else return (prng_stabledbn(prng,alpha));
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
ucomisd 0x142d(%rip), %xmm0     # 0x41d8
jne 0x2dbc
jp 0x2dbc
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x2b52
ucomisd 0x1244(%rip), %xmm0     # 0x4008
jne 0x2dee
jp 0x2dee
movq %rbx, %rdi
callq 0x29dd
cvtss2sd %xmm0, %xmm0
addsd 0x13ec(%rip), %xmm0     # 0x41c8
mulsd 0x13ec(%rip), %xmm0     # 0x41d0
addq $0x10, %rsp
popq %rbx
jmp 0x1150
movsd 0x13ea(%rip), %xmm1     # 0x41e0
ucomisd %xmm0, %xmm1
jbe 0x2e4b
movq %rbx, %rdi
callq 0x29dd
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x29dd
movss %xmm0, 0x4(%rsp)
movsd 0x13c4(%rip), %xmm1     # 0x41e8
movsd 0x8(%rsp), %xmm0
callq 0x1090
movss 0x13bd(%rip), %xmm1     # 0x41f4
ucomiss 0x4(%rsp), %xmm1
jbe 0x2e45
xorps 0x13cb(%rip), %xmm0     # 0x4210
addq $0x10, %rsp
popq %rbx
retq
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x2c4a
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: zeta
double zeta(long n, double theta)
{

  // the zeta function, used by the below zipf function
  // (this is not often called from outside this library)
  // ... but have made it public now to speed things up

  int i;
  double ans=0.0;

  for (i=1; i <= n; i++)
    ans += pow(1./(double)i, theta);
  return(ans);
}

// Assembly:
testq %rdi, %rdi
jle 0x2ec1
pushq %r14
pushq %rbx
subq $0x18, %rsp
movaps %xmm0, %xmm1
movq %rdi, %rbx
xorps %xmm0, %xmm0
xorl %r14d, %r14d
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
incq %r14
xorps %xmm2, %xmm2
cvtsi2sd %r14d, %xmm2
movsd 0x1179(%rip), %xmm0     # 0x4008
divsd %xmm2, %xmm0
callq 0x1090
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
cmpq %r14, %rbx
jne 0x2e76
addq $0x18, %rsp
popq %rbx
popq %r14
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/ranbenbasat[P]RHHH/prng.c
// Function: fastzipf
double fastzipf(double theta, long n, double zetan, prng_type * prng) {

  // this draws values from the zipf distribution
  // this is mainly useful for test generation purposes
  // n is range, theta is skewness parameter
  // theta = 0 gives uniform dbn,
  // theta > 1 gives highly skewed dbn.
  // original code due to Flip Korn, used with permission

	double alpha;
	double eta;
	double u;
	double uz;
	long double val;

  // randinit must be called before entering this procedure for
  // the first time since it uses the random generators

	alpha = 1. / (1. - theta);
	eta = (1. - pow(2./((double) n), 1. - theta)) 
	  / (1. - zeta(2.,theta)/zetan);

	u = prng_float(prng);
	uz = u * zetan;
	if (uz < 1.) val = 1;
	else if (uz < (1. + pow(0.5, theta))) val = 2;
	else val = 1 + (int64__t)(n * pow(eta*u - eta + 1., alpha));

	return(val);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movsd %xmm1, 0x8(%rsp)
movsd 0x112b(%rip), %xmm1     # 0x4008
cvtsi2sd %rdi, %xmm2
movapd %xmm0, 0x10(%rsp)
subsd %xmm0, %xmm1
movsd 0x12e4(%rip), %xmm0     # 0x41d8
movsd %xmm2, 0x40(%rsp)
divsd %xmm2, %xmm0
movsd %xmm1, 0x38(%rsp)
callq 0x1090
movsd %xmm0, 0x30(%rsp)
xorpd %xmm0, %xmm0
movq $-0x2, %r14
movsd %xmm0, (%rsp)
leal 0x3(%r14), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x10d6(%rip), %xmm0     # 0x4008
divsd %xmm1, %xmm0
movaps 0x10(%rsp), %xmm1
callq 0x1090
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
jne 0x2f1a
movq %rbx, %rdi
callq 0x29dd
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
movaps %xmm1, %xmm2
mulsd 0x8(%rsp), %xmm2
movsd 0x1090(%rip), %xmm0     # 0x4008
ucomisd %xmm2, %xmm0
ja 0x3019
movsd %xmm1, 0x28(%rsp)
movapd 0x10(%rsp), %xmm0
xorpd 0x127a(%rip), %xmm0     # 0x4210
movsd %xmm2, 0x10(%rsp)
callq 0x1040
addsd 0x105f(%rip), %xmm0     # 0x4008
ucomisd 0x10(%rsp), %xmm0
movsd 0x1221(%rip), %xmm0     # 0x41d8
ja 0x3019
movsd 0x1047(%rip), %xmm2     # 0x4008
movapd %xmm2, %xmm1
divsd 0x38(%rsp), %xmm1
movapd %xmm2, %xmm4
subsd 0x30(%rsp), %xmm4
movsd (%rsp), %xmm3
divsd 0x8(%rsp), %xmm3
subsd %xmm3, %xmm2
divsd %xmm2, %xmm4
movsd 0x28(%rsp), %xmm0
mulsd %xmm4, %xmm0
subsd %xmm4, %xmm0
addsd 0x100a(%rip), %xmm0     # 0x4008
callq 0x1090
mulsd 0x40(%rsp), %xmm0
cvttsd2si %xmm0, %rax
incq %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/vi[P]simple_cbor_stream_parse/dump_scsp_events.c
// Function: q_bytestring_chunk
SCSP_INT q_bytestring_chunk (SCSP_USERDATA userdata, const uint8_t* buf, size_t len) {
    int i;
    printf("bytestring_chunk(\"");
    for (i=0; i<len; ++i) {
        printf("\\x%02X", (int)buf[i]);
    }
    printf("\")\n");
    fflush(stdout);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x1dd5(%rip), %rdi      # 0x302a
xorl %eax, %eax
callq 0x1060
testq %rbx, %rbx
je 0x1282
leaq 0x1dd5(%rip), %r15      # 0x303d
xorl %r12d, %r12d
movzbl (%r14,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1060
incq %r12
cmpq %r12, %rbx
jne 0x126b
leaq 0x1e44(%rip), %rdi      # 0x30cd
callq 0x1050
movq 0x3d43(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
callq 0x1080
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/vi[P]simple_cbor_stream_parse/dump_scsp_events.c
// Function: q_string_chunk
SCSP_INT q_string_chunk (SCSP_USERDATA userdata, const uint8_t* buf, size_t len) {
    int i;
    printf("string_chunk(\"");
    for (i=0; i<len; ++i) {
        printf("\\x%02X", (int)buf[i]);
    }
    printf("\")\n");
    fflush(stdout);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x1d2c(%rip), %rdi      # 0x302e
xorl %eax, %eax
callq 0x1060
testq %rbx, %rbx
je 0x132f
leaq 0x1d28(%rip), %r15      # 0x303d
xorl %r12d, %r12d
movzbl (%r14,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1060
incq %r12
cmpq %r12, %rbx
jne 0x1318
leaq 0x1d97(%rip), %rdi      # 0x30cd
callq 0x1050
movq 0x3c96(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
callq 0x1080
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/vi[P]simple_cbor_stream_parse/dump_scsp_events.c
// Function: main
int main(int argc, char* argv[]) {
    if (argc != 2) {
        printf("Usage: dump_scsp_events {filename|-}\n");
        return 1;
    }
    int f;
    if (argv[1][0] == '-' && argv[1][1] == '\0') {
        f = 0;
    } else {
        f = open(argv[1], O_RDONLY);
        if (f == -1) {
            perror("open");
            return 2;
        }
    }
    
    if ( -1 == scsp_parse_from_fd(f, &q_callbacks, NULL) ) {
        fprintf(stderr, "Error reading CBOR\n");
        return 4;
    }
    
    return 0;
}

// Assembly:
pushq %rbx
cmpl $0x2, %edi
jne 0x152b
movq 0x8(%rsi), %rdi
cmpb $0x2d, (%rdi)
jne 0x14f9
cmpb $0x0, 0x1(%rdi)
je 0x1540
xorl %esi, %esi
xorl %eax, %eax
callq 0x10a0
movl %eax, %edi
cmpl $-0x1, %eax
je 0x1544
leaq 0x3b70(%rip), %rsi      # 0x5080
xorl %ebx, %ebx
xorl %edx, %edx
callq 0x2104
cmpq $-0x1, %rax
jne 0x153c
callq 0x10f0
movl $0x4, %ebx
jmp 0x153c
leaq 0x1bd3(%rip), %rdi      # 0x3105
callq 0x1050
movl $0x1, %ebx
movl %ebx, %eax
popq %rbx
retq
xorl %edi, %edi
jmp 0x1509
leaq 0x1b57(%rip), %rdi      # 0x30a2
callq 0x10b0
movl $0x2, %ebx
jmp 0x153c
nop
// File: /workspace/github_c_makefile_star2_O1/vi[P]simple_cbor_stream_parse/scsp.c
// Function: scsp_closeelements
SCSP_INT static scsp_closeelements(
                struct scsp_state* state, 
                struct scsp_callbacks* callbacks,
                SCSP_USERDATA userdata) {
    while (state->cur_depth > 0) {
        struct scsp_stack_entry* se1 = &state->stack[state->cur_depth- 1];
        if (se1->remaining >= 0) {
            if (se1->remaining == 0) {
                SCSP_DEBUG("internal error: remaining=0?\n");
                return -1;
            }
            se1->remaining -= 1;
            if (se1->remaining == 0) {
                switch(se1->type) {
                    case ']': 
                    case '[':
                         CALLBACK0(array_closed);
                         break;
                    case '{': 
                    case '}':
                        CALLBACK0(map_closed);
                        break;
                    case 'B':
                        CALLBACK0(bytestring_closed);
                        break;
                    case 'S':
                        CALLBACK0(string_closed);
                        break;
                    case 'b':
                    case 's':
                        SCSP_DEBUG("interal error 5\n");
                        return -1;
                    default: {
                        SCSP_DEBUG("internal error: se->type=%c ?\n", se1->type);
                        return -1;
                    }
                }
                state->cur_depth -= 1;
                continue;
            }
        } else {
            if (se1->type == '}') {
                if (se1->remaining == -1) {
                    se1->remaining = -2;
                } else {
                    se1->remaining = -1;
                }
            }
        }
        break;
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x8(%rdi), %r13
xorl %ebx, %ebx
movq (%r12), %rax
testq %rax, %rax
jle 0x2095
shlq $0x4, %rax
addq %r13, %rax
addq $-0x10, %rax
movq 0x8(%rax), %rdx
testq %rdx, %rdx
js 0x201a
je 0x2013
movl $0x3, %ecx
decq %rdx
movq %rdx, 0x8(%rax)
jne 0x2080
movzbl (%rax), %eax
cmpl $0x5c, %eax
jg 0x2034
cmpl $0x42, %eax
je 0x2059
cmpl $0x53, %eax
je 0x205f
cmpl $0x5b, %eax
je 0x2043
movl $0x1, %ecx
jmp 0x2080
movl $0x3, %ecx
cmpb $0x7d, (%rax)
jne 0x2080
cmpq $-0x1, %rdx
je 0x2049
movq $-0x1, 0x8(%rax)
jmp 0x2080
cmpl $0x7d, %eax
je 0x2053
cmpl $0x7b, %eax
je 0x2053
cmpl $0x5d, %eax
jne 0x2013
movq 0x48(%r15), %rax
jmp 0x2063
movq $-0x2, 0x8(%rax)
jmp 0x2080
movq 0x68(%r15), %rax
jmp 0x2063
movq 0x18(%r15), %rax
jmp 0x2063
movq 0x30(%r15), %rax
testq %rax, %rax
je 0x2077
movq %r14, %rdi
callq *%rax
movl $0x1, %ecx
testq %rax, %rax
js 0x2080
decq (%r12)
movl $0x2, %ecx
cmpl $0x2, %ecx
je 0x1fc7
cmpl $0x3, %ecx
je 0x2095
movq $-0x1, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/vi[P]simple_cbor_stream_parse/scsp.c
// Function: decode_half
static double decode_half(const unsigned char *halfp) {
     int half = (halfp[0] << 8) + halfp[1];
     int exp = (half >> 10) & 0x1f;
     int mant = half & 0x3ff;
     double val;
     if (exp == 0) val = ldexp(mant, -24);
     else if (exp != 31) val = ldexp(mant + 1024, exp - 25);
     else val = mant == 0 ? INFINITY : NAN;
     return half & 0x8000 ? -val : val;
   }

// Assembly:
pushq %rbx
movzbl (%rdi), %ebx
movzbl 0x1(%rdi), %ecx
movl %ebx, %edi
shrl $0x2, %edi
andl $0x1f, %edi
movl %ebx, %eax
andl $0x3, %eax
shll $0x8, %eax
orl %ecx, %eax
cmpl $0x1f, %edi
je 0x20d0
testl %edi, %edi
jne 0x20e5
cvtsi2sd %eax, %xmm0
movl $0xffffffe8, %edi       # imm = 0xFFFFFFE8
jmp 0x20f1
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leaq 0x10b2(%rip), %rax      # 0x3190
movsd (%rax,%rcx,8), %xmm0
jmp 0x20f6
orl $0x400, %eax            # imm = 0x400
cvtsi2sd %eax, %xmm0
addl $-0x19, %edi
callq 0x1040
testb %bl, %bl
jns 0x2102
xorpd 0x109e(%rip), %xmm0     # 0x31a0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/vi[P]simple_cbor_stream_parse/scsp.c
// Function: scsp_parse_from_fd
SCSP_INT SCSP_EXPORT scsp_parse_from_fd(
            int fd, 
            struct scsp_callbacks* callbacks,
            SCSP_USERDATA userdata)
{
    struct scsp_state     ss;
    ss.cur_depth = 0;
    uint8_t buf[8092];
    
    size_t read_cursor = 0;
    for(;;) {
        size_t len = read(fd, buf+read_cursor, (sizeof buf) - read_cursor);
        if (len == -1) {
            if (errno == EINTR) continue;
            if (errno == EAGAIN) { usleep(100000); continue; }
            return -1;
        }
        if (len == 0) break;
        
        len += read_cursor;
        read_cursor=0;
        
        size_t write_cursor = 0;
        while(write_cursor < len) {
            int ret2 = scsp_parse_lowlevel(&ss, callbacks, userdata, buf+write_cursor, len-write_cursor);
            if (ret2 == -1) {
                return -1;
            }
            if (ret2 == 0) {
                memmove(buf, buf+write_cursor, len-write_cursor);
                read_cursor = len-write_cursor;
                break;
            }
            write_cursor += ret2;
        }
        //fflush(stdout);
    }
    return read_cursor;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20c8, %rsp           # imm = 0x20C8
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edi, %r14d
leaq 0x18(%rsp), %rax
movq $0x0, (%rax)
xorl %r12d, %r12d
movl %edi, 0x4(%rsp)
leaq (%rsp,%r12), %rsi
addq $0x120, %rsi            # imm = 0x120
movl $0x1f9c, %edx           # imm = 0x1F9C
subq %r12, %rdx
movl %r14d, %edi
callq 0x1070
testq %rax, %rax
je 0x218b
movq %rax, %rbp
cmpq $-0x1, %rax
jne 0x2195
callq 0x1030
movl (%rax), %eax
movl $0x3, %ebx
cmpl $0x4, %eax
je 0x2218
cmpl $0xb, %eax
jne 0x2213
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x10d0
jmp 0x2218
movl $0x2, %ebx
jmp 0x2218
addq %r12, %rbp
xorl %r12d, %r12d
xorl %r14d, %r14d
xorl %ebx, %ebx
movq %rbp, %r13
subq %r14, %r13
jbe 0x220c
leaq (%rsp,%r14), %r15
addq $0x120, %r15            # imm = 0x120
leaq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
movq %r13, %r8
callq 0x1558
cmpl $-0x1, %eax
je 0x21f3
testl %eax, %eax
jne 0x21fa
leaq 0x120(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x1090
movl $0x5, %eax
movq %r13, %r12
jmp 0x2201
movl $0x1, %eax
jmp 0x2201
cltq
addq %rax, %r14
xorl %eax, %eax
testl %eax, %eax
je 0x219e
cmpl $0x5, %eax
je 0x220c
movl %eax, %ebx
movl 0x4(%rsp), %r14d
jmp 0x2218
movl $0x1, %ebx
testl %ebx, %ebx
je 0x2135
cmpl $0x3, %ebx
je 0x2135
cmpl $0x2, %ebx
je 0x2235
movq $-0x1, %r12
movq %r12, %rax
addq $0x20c8, %rsp           # imm = 0x20C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/vi[P]simple_cbor_stream_parse/scsp.c
// Function: scsp_parse_from_memory
SCSP_INT SCSP_EXPORT scsp_parse_from_memory(
            const void *buffer,
            size_t count,
            struct scsp_callbacks* callbacks,
            SCSP_USERDATA userdata)
{
    struct scsp_state     ss;
    ss.cur_depth = 0;
    
    const uint8_t *buf = (const uint8_t*)buffer;
    
    size_t write_cursor = 0;
    while(write_cursor < count) {
        int ret2 = scsp_parse_lowlevel(&ss, callbacks, userdata, buf+write_cursor, count-write_cursor);
        if (ret2 == -1) {
            return -1;
        }
        if (ret2 == 0) {
            break;
        }
        write_cursor += ret2;
    }
    
    return count - write_cursor;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movq %rsp, %r13
movq $0x0, (%r13)
xorl %ebp, %ebp
movq %rbx, %r8
subq %rbp, %r8
jbe 0x22b5
leaq (%r12,%rbp), %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1558
cmpl $-0x1, %eax
je 0x229e
testl %eax, %eax
jne 0x22a5
movl $0x3, %eax
jmp 0x22ac
movl $0x1, %eax
jmp 0x22ac
cltq
addq %rax, %rbp
xorl %eax, %eax
testl %eax, %eax
je 0x2274
cmpl $0x3, %eax
jne 0x22ba
subq %rbp, %rbx
jmp 0x22c1
movq $-0x1, %rbx
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/CkTD[P]btree/btree.c
// Function: bt_node_blk_none_leaf_make_space
void bt_node_blk_none_leaf_make_space(BTreeNodeBlk *blk, uint64_t index)
{
    char *src;
    char *dest;
    uint64_t n;

    assert(!(blk->type & BT_NODE_TYPE_LEAF));
    src = (char *)blk + sizeof(BTreeNodeBlk) + index * sizeof(uint64_t) * 2;
    dest = src + sizeof(uint64_t) * 2;
    n = (blk->key_counts - index) *  2 * sizeof(uint64_t) + sizeof(uint64_t);
    
    memmove(dest, src, n);
}

// Assembly:
testb $0x4, (%rdi)
jne 0x1281
movq %rsi, %rcx
shlq $0x4, %rcx
leaq (%rdi,%rcx), %rax
addq $0x28, %rax
addq %rdi, %rcx
addq $0x38, %rcx
movq 0x8(%rdi), %rdx
subq %rsi, %rdx
shlq $0x4, %rdx
orq $0x8, %rdx
movq %rcx, %rdi
movq %rax, %rsi
jmp 0x1110
pushq %rax
leaq 0x1d7b(%rip), %rdi      # 0x3004
leaq 0x1d95(%rip), %rsi      # 0x3025
leaq 0x1d96(%rip), %rcx      # 0x302d
movl $0x1c2, %edx            # imm = 0x1C2
callq 0x10b0