// File: /workspace/github_cpp_makefile_star2_O2/wenleix[P]EdgePPR/src/PPRCommon.cpp
// Function: ReadVector(double*, int, char const*, char const*)
void ReadVector(double *pprValue, int allocSize, const char* filename, const char* suffix) {
	char fullname[1000];
	sprintf(fullname, "%s.%s", filename, suffix);

	if (strcmp(suffix, "txt") == 0) {
		FILE *f = fopen(fullname, "r");
		int numRead = -1;
		int size = 0;
		numRead = fscanf(f, "%d", &size);
		assert(numRead == 1 && size == allocSize);
		for (int i = 0; i < size; i++) {
			numRead = fscanf(f, "%lf", &pprValue[i]);
			assert(numRead == 1);
		}
	} else if (strcmp(suffix, "bin") == 0) {
		FILE *f = fopen(fullname, "rb");
		int numRead;
		int size;
		numRead = fread(&size, sizeof(int), 1, f);
		assert(numRead == 1);
		assert(allocSize == size);
		numRead = fread(pprValue, sizeof(double), size, f);
		assert(numRead == size);
	} else {
		assert(false);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
movq %rcx, %r14
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x1e40(%rip), %rsi      # 0x54cc
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x2050
leaq 0x1a4e(%rip), %rsi      # 0x50ed
movq %r14, %rdi
callq 0x21e0
testl %eax, %eax
je 0x372f
leaq 0x1a33(%rip), %rsi      # 0x50e9
movq %r14, %rdi
callq 0x21e0
testl %eax, %eax
jne 0x37c2
leaq 0x1e81(%rip), %rsi      # 0x554e
leaq 0x10(%rsp), %rdi
callq 0x21a0
movq %rax, %r14
leaq 0xc(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rcx
callq 0x2200
cmpl $0x1, %eax
jne 0x37e1
cmpl %ebp, 0xc(%rsp)
jne 0x3800
movslq %ebp, %r15
pushq $0x8
popq %rsi
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2200
cmpl %r15d, %eax
jne 0x381f
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19b1(%rip), %rsi      # 0x50e7
leaq 0x10(%rsp), %rdi
callq 0x21a0
movq %rax, %r14
leaq 0xc(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x18ee(%rip), %rsi      # 0x5040
movq %rax, %rdi
xorl %eax, %eax
callq 0x2290
cmpl $0x1, %eax
jne 0x383e
cmpl %ebp, 0xc(%rsp)
jne 0x383e
pushq $-0x1
popq %r12
leaq 0x19de(%rip), %r15      # 0x5158
movslq 0xc(%rsp), %rax
incq %r12
cmpq %rax, %r12
jge 0x371d
leaq 0x8(%rbx), %r13
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2290
movq %r13, %rbx
cmpl $0x1, %eax
je 0x377a
leaq 0x1d97(%rip), %rdi      # 0x5541
leaq 0x1d43(%rip), %rsi      # 0x54f4
leaq 0x1d4e(%rip), %rcx      # 0x5506
movl $0xa5, %edx
callq 0x20e0
leaq 0x1daa(%rip), %rdi      # 0x5573
leaq 0x1d24(%rip), %rsi      # 0x54f4
leaq 0x1d2f(%rip), %rcx      # 0x5506
movl $0xb1, %edx
callq 0x20e0
leaq 0x1d59(%rip), %rdi      # 0x5541
leaq 0x1d05(%rip), %rsi      # 0x54f4
leaq 0x1d10(%rip), %rcx      # 0x5506
movl $0xac, %edx
callq 0x20e0
leaq 0x1d4a(%rip), %rdi      # 0x5551
leaq 0x1ce6(%rip), %rsi      # 0x54f4
leaq 0x1cf1(%rip), %rcx      # 0x5506
movl $0xad, %edx
callq 0x20e0
leaq 0x1d3d(%rip), %rdi      # 0x5563
leaq 0x1cc7(%rip), %rsi      # 0x54f4
leaq 0x1cd2(%rip), %rcx      # 0x5506
movl $0xaf, %edx
callq 0x20e0
leaq 0x1c8d(%rip), %rdi      # 0x54d2
leaq 0x1ca8(%rip), %rsi      # 0x54f4
leaq 0x1cb3(%rip), %rcx      # 0x5506
movl $0xa2, %edx
callq 0x20e0