// File: /workspace/github_c_makefile_star2_O0/DVaronos[P]AnLogProject1/logistic.c
// Function: TestAndAdd
void TestAndAdd(Hash* H,Model* model,JobSheduler* Sheduler,Input** input,double threshold){
	Job* job;
	int i,sum,who=0,start=1,msize=10,curr=0;
	TestStruct** current=malloc(sizeof(TestStruct*)*msize);
	NList** nodes;
	MakeArrays(H,&sum,&nodes); //Ftiaxnw ena array me NList komvous gia kathe kamera pou den exei klika
	while(who<(sum-1)){ //Gia oles aftes is kameres
		if(curr<msize){	//Ean iparxei xoros sto array
	    current[curr]=malloc(sizeof(TestStruct)*Sheduler->num);
	  }else{//Allios resize to array kata 10
	    msize+=10;
	    current=realloc(current,msize*sizeof(TestStruct*));
	    current[curr]=malloc(sizeof(TestStruct)*Sheduler->num);
	  }
		for(i=0 ; i<Sheduler->num ; i++){	//Gia kathe thread ftiakse ena TestStruct kai arxikopieise to
			current[curr][i].who=who;
			current[curr][i].start=start;
			start+=1000;
			if(start>=(sum-1)) start=sum-1;
			current[curr][i].end=start;
			current[curr][i].model=model;
			current[curr][i].threshold=threshold;
			current[curr][i].input=*input;
			current[curr][i].hash=H;
			current[curr][i].Sheduler=Sheduler;
			current[curr][i].nodes=nodes;
			current[curr][i].sum=sum-1;
			job=JobCreate(TestData,(void*)(current[curr]+i)); //ftiakse ena job
			JSAddWork(Sheduler,job); //Dose to job sto Sheduler
			start++;
			if(start==sum){
				who++;
				if(who==sum-1) break;
				start=who+1;
			}
		}
		JSWaitalltasks(Sheduler); //perimene na teliosoun ta threads
		curr++;
	}
	for(int k=0 ; k<curr ; k++){
		free(current[k]);
	}
	free(current);
	free(nodes);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x1, -0x40(%rbp)
movl $0xa, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movslq -0x44(%rbp), %rdi
shlq $0x3, %rdi
callq 0x1190
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x3a90
movl -0x3c(%rbp), %eax
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x3a47
movl -0x48(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x3809
movq -0x18(%rbp), %rax
movslq 0xa8(%rax), %rdi
shlq $0x6, %rdi
callq 0x1190
movq %rax, %rdx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x384a
movl -0x44(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x44(%rbp)
movq -0x50(%rbp), %rdi
movslq -0x44(%rbp), %rsi
shlq $0x3, %rsi
callq 0x11b0
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movslq 0xa8(%rax), %rdi
shlq $0x6, %rdi
callq 0x1190
movq %rax, %rdx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xa8(%rcx), %eax
jge 0x3a30
movl -0x3c(%rbp), %ecx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x34(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x40(%rbp), %ecx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x34(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0x40(%rbp), %eax
addl $0x3e8, %eax            # imm = 0x3E8
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jl 0x38be
movl -0x38(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %ecx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x34(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rcx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x34(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movsd -0x28(%rbp), %xmm0
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x34(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rcx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x34(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rcx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x34(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rax
movq %rcx, 0x38(%rax)
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x34(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rax
movq %rcx, 0x30(%rax)
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x34(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movslq -0x34(%rbp), %rax
shlq $0x6, %rax
addq %rax, %rsi
leaq 0x1e8(%rip), %rdi       # 0x3bc0
callq 0x74e0
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x7870
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x38(%rbp), %eax
jne 0x3a20
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3a17
jmp 0x3a30
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x3a22
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3851
movq -0x18(%rbp), %rdi
callq 0x78f0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x37cb
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x3a72
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1030
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x3a4e
movq -0x50(%rbp), %rdi
callq 0x1030
movq -0x58(%rbp), %rdi
callq 0x1030
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)