// File: /workspace/github_cpp_makefile_star2_O3/nwieder[P]SSTS/src/Input/Standard_Ipt.cpp
// Function: nw::Standard_Ipt::alloc_Voxel()
void Standard_Ipt::alloc_Voxel(){
	cout << "alloc Voxel... ";

//	border condition is equilibrium
	if(xgd.xml_border_condition == "equilibrium"){

// 		run through voxl list and create Standard_Voxel
		for (long i = 0; i < (long)xgd.xml_vxl_list.size(); i++){
			_Voxel* tvxl = 	new Standard_Vxl(xgd.xml_vxl_list[i]->xml_id,
							xgd.xml_box_lenght, clone_svc());
			vvc.push_back(tvxl);
		}

//		add border Voxel vvc.push_back(tbvxl);
		_Voxel* bv = new Border_Vxl(vvc.size(), xgd.xml_box_lenght, clone_svc());
		vvc.push_back(bv);

//		initialize the diffusion neighbors including the border voxel
		for (long i = 0; i < (long)xgd.xml_vxl_list.size(); i++){
			for (long j = 0; j < (long)xgd.xml_vxl_list[i]->xml_vxl_neighbours.size(); j++)
				vvc[i]->add_neighbour(vvc.at(xgd.xml_vxl_list[i]->xml_vxl_neighbours[j]));
			for (long j = vvc[i]->get_diff_vec()->size(); j < 6; j++){
//				fill every free spot of the diffusion neighbour vector with border voxel
//				(last element of the voxel vector)
				vvc[i]->add_neighbour(vvc.at(vvc.size()-1));
//				add current voxel to the diffusion neighbour vector of the border voxel
				vvc[vvc.size()-1]->add_neighbour(vvc[i]);
			}
	 	}

//	border condition is not equilibrium
	} else{
//		run through voxel list and create Standard_Voxel
		for (long i = 0; i < (long)xgd.xml_vxl_list.size(); i++){
			_Voxel* tvxl =	new Standard_Vxl(xgd.xml_vxl_list[i]->xml_id,
							xgd.xml_box_lenght, clone_svc());
			vvc.push_back(tvxl);
		}
//		initialize the diffusion neighbours including the border voxel
		for (long i = 0; i < (long)xgd.xml_vxl_list.size(); i++){
			for (long j = 0; j < (long)xgd.xml_vxl_list[i]->xml_vxl_neighbours.size(); j++){
				vvc[i]->add_neighbour(vvc.at(xgd.xml_vxl_list[i]->xml_vxl_neighbours[j]));
			}
		}
		cout << " *** NO BORDER VOXEL DEFINED *** ";
	}

	cout << "DONE" << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r14
movq 0x283c4(%rip), %r13     # 0x32fc8
leaq 0x19aa7(%rip), %rsi     # 0x246b2
movl $0xf, %edx
movq %r13, %rdi
callq 0x42f0
leaq 0x50(%r14), %rdi
leaq 0x19a71(%rip), %rsi     # 0x24694
callq 0x40a0
movq 0x128(%r14), %rbx
movq 0x130(%r14), %rcx
subq %rbx, %rcx
testl %eax, %eax
je 0xadbb
testq %rcx, %rcx
jle 0xad9e
leaq 0x468(%r14), %r15
xorl %r13d, %r13d
leaq 0x28(%rsp), %r12
movl $0x58, %edi
callq 0x42b0
movq %rax, %rbp
movq (%rbx,%r13,8), %rax
movq (%rax), %rbx
movsd 0x90(%r14), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0xbc98
movq %rbp, %rdi
movq %rbx, %rsi
movsd (%rsp), %xmm0
movq %r12, %rdx
callq 0xc228
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xacb0
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x42c0
movq %rbp, 0x8(%rsp)
movq 0x470(%r14), %rsi
cmpq 0x478(%r14), %rsi
je 0xacd2
movq %rbp, (%rsi)
addq $0x8, 0x470(%r14)
jmp 0xacdf
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0xd50c
incq %r13
movq 0x128(%r14), %rbx
movq 0x130(%r14), %rax
movq %rax, %rcx
subq %rbx, %rcx
movq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rdx, %r13
jl 0xac59
testq %rcx, %rcx
movq 0x282b8(%rip), %r13     # 0x32fc8
jle 0xad9e
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdx
movq 0x20(%rdx), %rcx
movq 0x28(%rdx), %rdx
subq %rcx, %rdx
testq %rdx, %rdx
jle 0xad88
xorl %r12d, %r12d
movq 0x468(%r14), %rax
movq 0x470(%r14), %rdx
movq (%rcx,%r12,8), %rsi
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0xb080
movq (%rax,%r15,8), %rdi
movq (%rax,%rsi,8), %rsi
callq 0xc338
incq %r12
movq 0x128(%r14), %rbx
movq (%rbx,%r15,8), %rax
movq 0x20(%rax), %rcx
movq 0x28(%rax), %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %rax, %r12
jl 0xad30
movq 0x130(%r14), %rax
incq %r15
movq %rax, %rcx
subq %rbx, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
jl 0xad19
movq 0x28223(%rip), %rdi     # 0x32fc8
leaq 0x19916(%rip), %rsi     # 0x246c2
movl $0x21, %edx
callq 0x42f0
jmp 0xb031
testq %rcx, %rcx
jle 0xae7a
leaq 0x468(%r14), %r15
xorl %r13d, %r13d
leaq 0x40(%rsp), %r12
movl $0x58, %edi
callq 0x42b0
movq %rax, %rbp
movq (%rbx,%r13,8), %rax
movq (%rax), %rbx
movsd 0x90(%r14), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0xbc98
movq %rbp, %rdi
movq %rbx, %rsi
movsd (%rsp), %xmm0
movq %r12, %rdx
callq 0xc228
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xae2a
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x42c0
movq %rbp, 0x8(%rsp)
movq 0x470(%r14), %rsi
cmpq 0x478(%r14), %rsi
je 0xae4c
movq %rbp, (%rsi)
addq $0x8, 0x470(%r14)
jmp 0xae59
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0xd50c
incq %r13
movq 0x128(%r14), %rbx
movq 0x130(%r14), %rax
subq %rbx, %rax
sarq $0x3, %rax
cmpq %rax, %r13
jl 0xadd3
movl $0x58, %edi
callq 0x42b0
movq %rax, %r12
movq 0x470(%r14), %r15
movq 0x468(%r14), %rbx
movsd 0x90(%r14), %xmm0
movsd %xmm0, (%rsp)
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0xbc98
subq %rbx, %r15
sarq $0x3, %r15
leaq 0x10(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
callq 0xc2b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xaee3
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x42c0
leaq 0x468(%r14), %r15
movq %r12, 0x8(%rsp)
movq 0x470(%r14), %rsi
cmpq 0x478(%r14), %rsi
movq 0x280c4(%rip), %r13     # 0x32fc8
je 0xaf13
movq %r12, (%rsi)
addq $0x8, 0x470(%r14)
jmp 0xaf20
leaq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0xd50c
movq 0x128(%r14), %rax
movq 0x130(%r14), %rcx
subq %rax, %rcx
testq %rcx, %rcx
jle 0xb031
xorl %ebx, %ebx
movq (%rax,%rbx,8), %rdx
movq 0x20(%rdx), %rcx
movq 0x28(%rdx), %rdx
subq %rcx, %rdx
testq %rdx, %rdx
jle 0xafa4
xorl %r12d, %r12d
movq 0x468(%r14), %rax
movq 0x470(%r14), %rdx
movq (%rcx,%r12,8), %rsi
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0xb080
movq (%rax,%rbx,8), %rdi
movq (%rax,%rsi,8), %rsi
callq 0xc338
incq %r12
movq 0x128(%r14), %rax
movq (%rax,%rbx,8), %rdx
movq 0x20(%rdx), %rcx
movq 0x28(%rdx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rdx, %r12
jl 0xaf53
movq (%r15), %rcx
movq (%rcx,%rbx,8), %rcx
movq 0x48(%rcx), %r12
subq 0x40(%rcx), %r12
sarq $0x3, %r12
cmpq $0x5, %r12
jg 0xb017
addq $-0x6, %r12
movq 0x468(%r14), %rax
movq 0x470(%r14), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rax, %rcx
je 0xb07c
movq (%rax,%rbx,8), %rdi
movq -0x8(%rax,%rdx,8), %rsi
callq 0xc338
movq 0x468(%r14), %rax
movq 0x470(%r14), %rcx
movq -0x8(%rcx), %rdi
movq (%rax,%rbx,8), %rsi
callq 0xc338
incq %r12
jne 0xafc1
movq 0x128(%r14), %rax
incq %rbx
movq 0x130(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %rbx
jl 0xaf3c
leaq 0x194d1(%rip), %rsi     # 0x24509
movl $0x4, %edx
movq %r13, %rdi
callq 0x42f0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x4280
movsbl %al, %esi
movq %r13, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4190
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x1(%rdx), %rsi
leaq 0x18fbc(%rip), %rdi     # 0x24043
xorl %eax, %eax
callq 0x4430
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xb0ad
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x42c0
jmp 0xb0ad
movq %rax, %rbx
movl $0x58, %esi
movq %r12, %rdi
jmp 0xb0f4
jmp 0xb0cd
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xb0ec
movq 0x50(%rsp), %rsi
jmp 0xb0e4
movq %rax, %rbx
jmp 0xb0ec
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xb0ec
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x42c0
movl $0x58, %esi
movq %rbp, %rdi
callq 0x42c0
movq %rbx, %rdi
callq 0x4510
nop