// File: /workspace/github_c_makefile_star2_O0/guszejnovdavid[P]MISFIT/Restart.cpp
// Function: ReadRestartFile(long)
void ReadRestartFile(long NData)
{

	long i,j;
	char line[100];
	FILE* sourcefile;
    char filename[200];

	//Get filename
	ContructFilePath("Restart_Inputs.txt", "Output", filename);
	//open file
    sourcefile=fopen(filename,"r");
    for(i=0;i<NData;i++){
    	// Rho
    	for(j=0;j<NgridTotal;j++){
     		fgets (line, 100, sourcefile);
			InputStorage[i].rho_field[j]=strtod(line, NULL);
		}
    	// T
    	for(j=0;j<NgridTotal;j++){
     		fgets (line, 100, sourcefile);
			InputStorage[i].T_field[j]=strtod(line, NULL);
		}
		// R0
     	fgets (line, 100, sourcefile);
		InputStorage[i].R0=strtod(line, NULL);
		// X0,Y0,Z0
     	fgets (line, 100, sourcefile);
		InputStorage[i].X0=strtod(line, NULL);
     	fgets (line, 100, sourcefile);
		InputStorage[i].Y0=strtod(line, NULL);
     	fgets (line, 100, sourcefile);
		InputStorage[i].Z0=strtod(line, NULL);
		// MachEdge
     	fgets (line, 100, sourcefile);
		InputStorage[i].Machedge=strtod(line, NULL);
		// VX0,VY0,VZ0
     	fgets (line, 100, sourcefile);
		InputStorage[i].RelativeVelocityX=strtod(line, NULL);
     	fgets (line, 100, sourcefile);
		InputStorage[i].RelativeVelocityY=strtod(line, NULL);
     	fgets (line, 100, sourcefile);
		InputStorage[i].RelativeVelocityZ=strtod(line, NULL);
		// Initscale
     	fgets (line, 100, sourcefile);
		InputStorage[i].InitScale=strtod(line, NULL);
		// tparent
     	fgets (line, 100, sourcefile);
		InputStorage[i].tparent=strtod(line, NULL);	
		//Vector elements
		IsUsed[i]=true;
		InputPriority[i]=PriorityFunction(&InputStorage[i]);
    }
	fclose(sourcefile);
	NInputCurrent=NData;
	remove(filename);
		
}

// Assembly:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x150(%rsp)
movq %rsp, %rdx
leaq 0x353a(%rip), %rdi      # 0x1c213
leaq 0x34a8(%rip), %rsi      # 0x1c188
callq 0x173f0
movq %rsp, %rdi
leaq 0x3a99(%rip), %rsi      # 0x1c788
callq 0x8770
movq %rax, 0xc8(%rsp)
movq $0x0, 0x148(%rsp)
movq 0x148(%rsp), %rax
cmpq 0x150(%rsp), %rax
jge 0x19180
movq $0x0, 0x140(%rsp)
cmpq $0x8000, 0x140(%rsp) # imm = 0x8000
jge 0x18d9f
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x99d6(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movq 0x140(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x140(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x140(%rsp)
jmp 0x18d2a
movq $0x0, 0x140(%rsp)
cmpq $0x8000, 0x140(%rsp) # imm = 0x8000
jge 0x18e24
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x9955(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movq 0x140(%rsp), %rcx
movsd %xmm0, 0x40000(%rax,%rcx,8)
movq 0x140(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x140(%rsp)
jmp 0x18dab
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x98ea(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movsd %xmm0, 0x80000(%rax)
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x989e(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movsd %xmm0, 0x80008(%rax)
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x9852(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movsd %xmm0, 0x80010(%rax)
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x9806(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movsd %xmm0, 0x80018(%rax)
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x97ba(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movsd %xmm0, 0x80020(%rax)
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x976e(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movsd %xmm0, 0x80028(%rax)
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x9722(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movsd %xmm0, 0x80030(%rax)
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x96d6(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movsd %xmm0, 0x80038(%rax)
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x968a(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movsd %xmm0, 0x80040(%rax)
leaq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rdx
movl $0x64, %esi
callq 0x8a70
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8480
leaq 0x963e(%rip), %rax      # 0x22740
movq (%rax), %rax
imulq $0x80050, 0x148(%rsp), %rcx # imm = 0x80050
addq %rcx, %rax
movsd %xmm0, 0x80048(%rax)
leaq 0x962d(%rip), %rax      # 0x22750
movq (%rax), %rax
movq 0x148(%rsp), %rcx
movb $0x1, (%rax,%rcx)
leaq 0x9607(%rip), %rax      # 0x22740
movq (%rax), %rdi
imulq $0x80050, 0x148(%rsp), %rax # imm = 0x80050
addq %rax, %rdi
callq 0x16ff0
leaq 0x95f1(%rip), %rax      # 0x22748
movq (%rax), %rax
movq 0x148(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x148(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x148(%rsp)
jmp 0x18d08
movq 0xc8(%rsp), %rdi
callq 0x8650
movq 0x150(%rsp), %rcx
leaq 0x95c4(%rip), %rax      # 0x22760
movq %rcx, (%rax)
movq %rsp, %rdi
callq 0x8c10
addq $0x158, %rsp            # imm = 0x158
retq
nop