// File: 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
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq 0x50a1f(%rip), %rdi     # 0x5dfd0
leaq 0x380b2(%rip), %rsi     # 0x4566a
callq 0x5300
movq -0xc8(%rbp), %rdi
addq $0x30, %rdi
addq $0x20, %rdi
leaq 0x38079(%rip), %rsi     # 0x4564c
callq 0xf6e0
testb $0x1, %al
jne 0xd5e1
jmp 0xda3d
movq $0x0, -0x10(%rbp)
movq -0xc8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
addq $0x30, %rdi
addq $0xf8, %rdi
callq 0xeec0
movq %rax, %rcx
movq -0xd0(%rbp), %rax
cmpq %rcx, %rax
jge 0xd71b
movl $0x58, %edi
callq 0x5320
movq -0xc8(%rbp), %rdi
movq %rax, -0xe8(%rbp)
movb $0x1, -0x3d(%rbp)
addq $0x128, %rdi            # imm = 0x128
movq -0x10(%rbp), %rsi
callq 0xeee0
movq -0xc8(%rbp), %rsi
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
movsd 0x90(%rsi), %xmm0
movsd %xmm0, -0xd8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xe990
jmp 0xd679
movsd -0xd8(%rbp), %xmm0
movq -0xe0(%rbp), %rsi
movq -0xe8(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0xf980
jmp 0xd69a
movb $0x0, -0x3d(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xf0d0
movq -0xe8(%rbp), %rax
movq -0xc8(%rbp), %rdi
movq %rax, -0x18(%rbp)
addq $0x468, %rdi            # imm = 0x468
leaq -0x18(%rbp), %rsi
callq 0xfa30
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xd5e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xd6fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xf0d0
testb $0x1, -0x3d(%rbp)
jne 0xd705
jmp 0xd716
movq -0xe8(%rbp), %rdi
movl $0x58, %esi
callq 0x5330
jmp 0xdd2b
movl $0x58, %edi
callq 0x5320
movq -0xc8(%rbp), %rdi
movq %rax, -0x100(%rbp)
movb $0x1, -0x61(%rbp)
addq $0x468, %rdi            # imm = 0x468
callq 0x7af0
movq -0xc8(%rbp), %rsi
movq %rax, -0xf8(%rbp)
movsd 0x90(%rsi), %xmm0
movsd %xmm0, -0xf0(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xe990
jmp 0xd76c
movsd -0xf0(%rbp), %xmm0
movq -0xf8(%rbp), %rsi
movq -0x100(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0xfaa0
jmp 0xd78d
movb $0x0, -0x61(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xf0d0
movq -0x100(%rbp), %rax
movq -0xc8(%rbp), %rdi
movq %rax, -0x48(%rbp)
addq $0x468, %rdi            # imm = 0x468
leaq -0x48(%rbp), %rsi
callq 0xfa30
movq $0x0, -0x70(%rbp)
movq -0xc8(%rbp), %rdi
movq -0x70(%rbp), %rax
movq %rax, -0x108(%rbp)
addq $0x30, %rdi
addq $0xf8, %rdi
callq 0xeec0
movq %rax, %rcx
movq -0x108(%rbp), %rax
cmpq %rcx, %rax
jge 0xda38
movq $0x0, -0x78(%rbp)
movq -0xc8(%rbp), %rdi
movq -0x78(%rbp), %rax
movq %rax, -0x110(%rbp)
addq $0x30, %rdi
addq $0xf8, %rdi
movq -0x70(%rbp), %rsi
callq 0xeee0
movq (%rax), %rdi
addq $0x20, %rdi
callq 0x6d10
movq %rax, %rcx
movq -0x110(%rbp), %rax
cmpq %rcx, %rax
jge 0xd912
movq -0xc8(%rbp), %rdi
addq $0x468, %rdi            # imm = 0x468
movq -0x70(%rbp), %rsi
callq 0x8180
movq -0xc8(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x118(%rbp)
movq %rdi, %rax
addq $0x468, %rax            # imm = 0x468
movq %rax, -0x120(%rbp)
addq $0x30, %rdi
addq $0xf8, %rdi
movq -0x70(%rbp), %rsi
callq 0xeee0
movq (%rax), %rdi
addq $0x20, %rdi
movq -0x78(%rbp), %rsi
callq 0x70f0
movq -0x120(%rbp), %rdi
movq (%rax), %rsi
callq 0x7b10
movq -0x118(%rbp), %rdi
movq (%rax), %rsi
callq 0xfb50
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0xd801
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xd8f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xf0d0
testb $0x1, -0x61(%rbp)
jne 0xd8fc
jmp 0xd90d
movq -0x100(%rbp), %rdi
movl $0x58, %esi
callq 0x5330
jmp 0xdd2b
movq -0xc8(%rbp), %rdi
addq $0x468, %rdi            # imm = 0x468
movq -0x70(%rbp), %rsi
callq 0x8180
movq (%rax), %rdi
callq 0x7ad0
movq %rax, %rdi
callq 0x7af0
movq %rax, -0x80(%rbp)
cmpq $0x6, -0x80(%rbp)
jge 0xda25
movq -0xc8(%rbp), %rdi
addq $0x468, %rdi            # imm = 0x468
movq -0x70(%rbp), %rsi
callq 0x8180
movq -0xc8(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x138(%rbp)
movq %rdi, %rax
addq $0x468, %rax            # imm = 0x468
movq %rax, -0x140(%rbp)
addq $0x468, %rdi            # imm = 0x468
callq 0x7af0
movq -0x140(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x7b10
movq -0x138(%rbp), %rdi
movq (%rax), %rsi
callq 0xfb50
movq -0xc8(%rbp), %rdi
movq %rdi, %rax
addq $0x468, %rax            # imm = 0x468
movq %rax, -0x130(%rbp)
addq $0x468, %rdi            # imm = 0x468
callq 0x7af0
movq -0x130(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x8180
movq -0xc8(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x128(%rbp)
addq $0x468, %rdi            # imm = 0x468
movq -0x70(%rbp), %rsi
callq 0x8180
movq -0x128(%rbp), %rdi
movq (%rax), %rsi
callq 0xfb50
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0xd93d
jmp 0xda27
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0xd7c4
jmp 0xdd00
movq $0x0, -0x88(%rbp)
movq -0xc8(%rbp), %rdi
movq -0x88(%rbp), %rax
movq %rax, -0x148(%rbp)
addq $0x30, %rdi
addq $0xf8, %rdi
callq 0xeec0
movq %rax, %rcx
movq -0x148(%rbp), %rax
cmpq %rcx, %rax
jge 0xdba1
movl $0x58, %edi
callq 0x5320
movq -0xc8(%rbp), %rdi
movq %rax, -0x160(%rbp)
movb $0x1, -0xa9(%rbp)
addq $0x128, %rdi            # imm = 0x128
movq -0x88(%rbp), %rsi
callq 0xeee0
movq -0xc8(%rbp), %rsi
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x158(%rbp)
movsd 0x90(%rsi), %xmm0
movsd %xmm0, -0x150(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xe990
jmp 0xdae4
movsd -0x150(%rbp), %xmm0
movq -0x158(%rbp), %rsi
movq -0x160(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0xf980
jmp 0xdb08
movb $0x0, -0xa9(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xf0d0
movq -0x160(%rbp), %rax
movq -0xc8(%rbp), %rdi
movq %rax, -0x90(%rbp)
addq $0x468, %rdi            # imm = 0x468
leaq -0x90(%rbp), %rsi
callq 0xfa30
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0xda48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xdb80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xf0d0
testb $0x1, -0xa9(%rbp)
jne 0xdb8b
jmp 0xdb9c
movq -0x160(%rbp), %rdi
movl $0x58, %esi
callq 0x5330
jmp 0xdd2b
movq $0x0, -0xb8(%rbp)
movq -0xc8(%rbp), %rdi
movq -0xb8(%rbp), %rax
movq %rax, -0x168(%rbp)
addq $0x30, %rdi
addq $0xf8, %rdi
callq 0xeec0
movq %rax, %rcx
movq -0x168(%rbp), %rax
cmpq %rcx, %rax
jge 0xdced
movq $0x0, -0xc0(%rbp)
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rax
movq %rax, -0x170(%rbp)
addq $0x30, %rdi
addq $0xf8, %rdi
movq -0xb8(%rbp), %rsi
callq 0xeee0
movq (%rax), %rdi
addq $0x20, %rdi
callq 0x6d10
movq %rax, %rcx
movq -0x170(%rbp), %rax
cmpq %rcx, %rax
jge 0xdcd4
movq -0xc8(%rbp), %rdi
addq $0x468, %rdi            # imm = 0x468
movq -0xb8(%rbp), %rsi
callq 0x8180
movq -0xc8(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x178(%rbp)
movq %rdi, %rax
addq $0x468, %rax            # imm = 0x468
movq %rax, -0x180(%rbp)
addq $0x30, %rdi
addq $0xf8, %rdi
movq -0xb8(%rbp), %rsi
callq 0xeee0
movq (%rax), %rdi
addq $0x20, %rdi
movq -0xc0(%rbp), %rsi
callq 0x70f0
movq -0x180(%rbp), %rdi
movq (%rax), %rsi
callq 0x7b10
movq -0x178(%rbp), %rdi
movq (%rax), %rsi
callq 0xfb50
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
jmp 0xdbef
jmp 0xdcd6
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
jmp 0xdbac
movq 0x502dc(%rip), %rdi     # 0x5dfd0
leaq 0x3797f(%rip), %rsi     # 0x4567a
callq 0x5300
movq 0x502c9(%rip), %rdi     # 0x5dfd0
leaq 0x377b3(%rip), %rsi     # 0x454c1
callq 0x5300
movq %rax, %rdi
movq 0x50283(%rip), %rsi     # 0x5dfa0
callq 0x5340
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x5650
nopw %cs:(%rax,%rax)