// File: /workspace/github_c_makefile_star2_O0/ranbenbasat[P]RHHH/ulossycount.c
// Function: LCU_Init
LCU_type * LCU_Init(float fPhi)
{
	int i;
	int k = 1 + (int) 1.0/fPhi;

	LCU_type* result = (LCU_type*) calloc(1,sizeof(LCU_type));

	result->a= (long long) 698124007;
	result->b= (long long) 5125833;
	if (k<1) k=1;
	result->k=k;
	result->n=0;  

	result->tblsz=LCU_HASHMULT*k;  
	result->hashtable=(LCUITEM**) calloc(result->tblsz,sizeof(LCUITEM *));
	result->groups=(LCUGROUP *)calloc(k,sizeof(LCUGROUP));
	result->items=(LCUITEM *) calloc(k,sizeof(LCUITEM));
	result->freegroups=(LCUGROUP **) calloc(k,sizeof(LCUGROUP*));

	for (i=0; i<result->tblsz;i++) 
		result->hashtable[i]=NULL;

	result->root=result->groups;
	result->groups->count=0;
	result->groups->nextg=NULL;
	result->groups->previousg=NULL;

	result->groups->items=result->items;
	for (i=0; i<k;i++)
		result->freegroups[i]=&result->groups[i];
	result->gpt=1; // initialize list of free groups

	for (i=0;i<k;i++) 
	{
		result->items[i].item=LCL_NULLITEM;
		result->items[i].delta=0;
		result->items[i].hash=-1;
		result->items[i].nexti=NULL;
		result->items[i].previousi=NULL;  // initialize values

		result->items[i].parentg=result->groups;
		result->items[i].nexting=&(result->items[i+1]);
		result->items[i].previousing=&(result->items[i-1]); 
		// create doubly linked list
	}
	result->items[0].previousing=&(result->items[k-1]);
	result->items[k-1].nexting=&(result->items[0]);
	// fix start and end of linked list

	return(result);
}

// Assembly:
subq $0x18, %rsp
movss %xmm0, 0x14(%rsp)
movss 0x2e42(%rip), %xmm1     # 0x5164
divss 0x14(%rsp), %xmm1
movss 0x2e34(%rip), %xmm0     # 0x5164
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, 0xc(%rsp)
movl $0x1, %edi
movl $0x48, %esi
callq 0x10f0
movq %rax, (%rsp)
movq (%rsp), %rax
movq $0x299c86e7, 0x10(%rax) # imm = 0x299C86E7
movq (%rsp), %rax
movq $0x4e36c9, 0x18(%rax)   # imm = 0x4E36C9
cmpl $0x1, 0xc(%rsp)
jge 0x2376
movl $0x1, 0xc(%rsp)
movl 0xc(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0x8(%rax)
movq (%rsp), %rax
movl $0x0, (%rax)
imull $0x3, 0xc(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0xc(%rax)
movq (%rsp), %rax
movslq 0xc(%rax), %rdi
movl $0x8, %esi
callq 0x10f0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x40(%rax)
movslq 0xc(%rsp), %rdi
movl $0x20, %esi
callq 0x10f0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x30(%rax)
movslq 0xc(%rsp), %rdi
movl $0x38, %esi
callq 0x10f0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x28(%rax)
movslq 0xc(%rsp), %rdi
movl $0x8, %esi
callq 0x10f0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x38(%rax)
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
movq (%rsp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x2439
movq (%rsp), %rax
movq 0x40(%rax), %rax
movslq 0x10(%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x240a
movq (%rsp), %rax
movq 0x30(%rax), %rcx
movq (%rsp), %rax
movq %rcx, 0x20(%rax)
movq (%rsp), %rax
movq 0x30(%rax), %rax
movl $0x0, (%rax)
movq (%rsp), %rax
movq 0x30(%rax), %rax
movq $0x0, 0x18(%rax)
movq (%rsp), %rax
movq 0x30(%rax), %rax
movq $0x0, 0x10(%rax)
movq (%rsp), %rax
movq 0x28(%rax), %rcx
movq (%rsp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x8(%rax)
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0xc(%rsp), %eax
jge 0x24cf
movq (%rsp), %rax
movq 0x30(%rax), %rdx
movslq 0x10(%rsp), %rax
shlq $0x5, %rax
addq %rax, %rdx
movq (%rsp), %rax
movq 0x38(%rax), %rax
movslq 0x10(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x2493
movq (%rsp), %rax
movl $0x1, 0x4(%rax)
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0xc(%rsp), %eax
jge 0x2608
movq (%rsp), %rax
movq 0x28(%rax), %rax
movslq 0x10(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl $0x7fffffff, (%rax)     # imm = 0x7FFFFFFF
movq (%rsp), %rax
movq 0x28(%rax), %rax
movslq 0x10(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movq (%rsp), %rax
movq 0x28(%rax), %rax
movslq 0x10(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq (%rsp), %rax
movq 0x28(%rax), %rax
movslq 0x10(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x20(%rax)
movq (%rsp), %rax
movq 0x28(%rax), %rax
movslq 0x10(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x18(%rax)
movq (%rsp), %rax
movq 0x30(%rax), %rcx
movq (%rsp), %rax
movq 0x28(%rax), %rax
movslq 0x10(%rsp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq (%rsp), %rax
movq 0x28(%rax), %rcx
movl 0x10(%rsp), %eax
addl $0x1, %eax
cltq
imulq $0x38, %rax, %rax
addq %rax, %rcx
movq (%rsp), %rax
movq 0x28(%rax), %rax
movslq 0x10(%rsp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x28(%rax)
movq (%rsp), %rax
movq 0x28(%rax), %rcx
movl 0x10(%rsp), %eax
subl $0x1, %eax
cltq
imulq $0x38, %rax, %rax
addq %rax, %rcx
movq (%rsp), %rax
movq 0x28(%rax), %rax
movslq 0x10(%rsp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x30(%rax)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x24e2
movq (%rsp), %rax
movq 0x28(%rax), %rcx
movl 0xc(%rsp), %eax
subl $0x1, %eax
cltq
imulq $0x38, %rax, %rax
addq %rax, %rcx
movq (%rsp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x30(%rax)
movq (%rsp), %rax
movq 0x28(%rax), %rcx
movq (%rsp), %rax
movq 0x28(%rax), %rax
movl 0xc(%rsp), %edx
subl $0x1, %edx
movslq %edx, %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x28(%rax)
movq (%rsp), %rax
addq $0x18, %rsp
retq
nopw (%rax,%rax)