// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movq 0x26dc8(%rip), %rdi     # 0x2efc8
leaq 0x1648b(%rip), %rsi     # 0x1e692
callq 0x4240
leaq 0x50(%rbx), %rdi
leaq 0x1645d(%rip), %rsi     # 0x1e674
callq 0x909f
leaq 0x468(%rbx), %r14
xorl %r13d, %r13d
testb %al, %al
je 0x82a9
leaq 0x40(%rsp), %r12
movq 0x128(%rbx), %r15
movq 0x130(%rbx), %rax
subq %r15, %rax
sarq $0x3, %rax
pushq $0x58
popq %rdi
cmpq %rax, %r13
jge 0x832b
callq 0x4260
movq %rax, %rbp
movq (%r15,%r13,8), %rax
movq (%rax), %r15
movsd 0x90(%rbx), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x8c68
movq %rbp, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
movq %r12, %rdx
callq 0x91ea
movq %r12, %rdi
callq 0x9c1e
movq %rbp, 0x8(%rsp)
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x9258
incq %r13
jmp 0x822f
leaq 0x28(%rsp), %r12
movq 0x128(%rbx), %r15
movq 0x130(%rbx), %rax
movq %rax, %rcx
subq %r15, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r13
jge 0x8460
pushq $0x58
popq %rdi
callq 0x4260
movq %rax, %rbp
movq (%r15,%r13,8), %rax
movq (%rax), %r15
movsd 0x90(%rbx), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x8c68
movq %rbp, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
movq %r12, %rdx
callq 0x91ea
movq %r12, %rdi
callq 0x9c1e
movq %rbp, 0x8(%rsp)
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x9258
incq %r13
jmp 0x82ae
callq 0x4260
movq %rax, %r15
movq 0x470(%rbx), %r12
movq 0x468(%rbx), %r13
movsd 0x90(%rbx), %xmm0
movsd %xmm0, (%rsp)
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x8c68
subq %r13, %r12
sarq $0x3, %r12
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
movq %r12, %rsi
movsd (%rsp), %xmm0
callq 0x9276
leaq 0x10(%rsp), %rdi
callq 0x9c1e
leaq 0x8(%rsp), %rsi
movq %r15, (%rsi)
movq %r14, %rdi
callq 0x9258
xorl %r12d, %r12d
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r12
jge 0x84d7
xorl %r13d, %r13d
movq (%rax,%r12,8), %rcx
movq 0x20(%rcx), %rax
movq 0x28(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movq (%r14), %rdx
movq (%rdx,%r12,8), %r15
cmpq %rcx, %r13
jge 0x83f7
movq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0x52aa
movq (%rax), %rsi
movq %r15, %rdi
callq 0x92e4
incq %r13
movq 0x128(%rbx), %rax
jmp 0x83b5
movq 0x48(%r15), %r13
subq 0x40(%r15), %r13
sarq $0x3, %r13
cmpq $0x6, %r13
jge 0x8458
movq 0x468(%rbx), %rax
movq 0x470(%rbx), %rsi
movq (%rax,%r12,8), %r15
subq %rax, %rsi
sarq $0x3, %rsi
decq %rsi
movq %r14, %rdi
callq 0x52aa
movq (%rax), %rsi
movq %r15, %rdi
callq 0x92e4
movq 0x468(%rbx), %rax
movq 0x470(%rbx), %rcx
movq -0x8(%rcx), %rdi
movq (%rax,%r12,8), %rsi
callq 0x92e4
incq %r13
jmp 0x8403
incq %r12
jmp 0x8394
xorl %r12d, %r12d
subq %r15, %rax
sarq $0x3, %rax
cmpq %rax, %r12
jge 0x84c4
xorl %r13d, %r13d
movq (%r15,%r12,8), %rcx
movq 0x20(%rcx), %rax
movq 0x28(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r13
jge 0x84b8
movq 0x468(%rbx), %rcx
movq (%rcx,%r12,8), %r15
movq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0x52aa
movq (%rax), %rsi
movq %r15, %rdi
callq 0x92e4
incq %r13
movq 0x128(%rbx), %r15
jmp 0x8472
incq %r12
movq 0x130(%rbx), %rax
jmp 0x8463
movq 0x26afd(%rip), %rdi     # 0x2efc8
leaq 0x161d0(%rip), %rsi     # 0x1e6a2
callq 0x4240
movq 0x26aea(%rip), %rdi     # 0x2efc8
leaq 0x16004(%rip), %rsi     # 0x1e4e9
callq 0x4240
movq %rax, %rdi
callq 0x4100
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x9c1e
jmp 0x8513
movq %rax, %rbx
pushq $0x58
popq %rsi
movq %r15, %rdi
jmp 0x853f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x852f
jmp 0x8536
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x9c1e
jmp 0x8539
movq %rax, %rbx
pushq $0x58
popq %rsi
movq %rbp, %rdi
callq 0x4270
movq %rbx, %rdi
callq 0x44f0