// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rcx, %r14
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x1bee(%rip), %rsi      # 0x552c
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x2050
leaq 0x17cc(%rip), %rsi      # 0x511d
movq %r14, %rdi
callq 0x21d0
testl %eax, %eax
je 0x39f4
leaq 0x17b1(%rip), %rsi      # 0x5119
movq %r14, %rdi
callq 0x21d0
testl %eax, %eax
jne 0x3a9a
leaq 0x1c2f(%rip), %rsi      # 0x55ae
leaq 0x10(%rsp), %rdi
callq 0x2190
movq %rax, %r14
leaq 0xc(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x21f0
cmpl $0x1, %eax
jne 0x3ab9
cmpl %ebp, 0xc(%rsp)
jne 0x3ad8
movslq %ebp, %r15
movl $0x8, %esi
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x21f0
cmpl %r15d, %eax
je 0x3a6b
leaq 0x1be7(%rip), %rdi      # 0x55c3
leaq 0x1b71(%rip), %rsi      # 0x5554
leaq 0x1b7c(%rip), %rcx      # 0x5566
movl $0xaf, %edx
callq 0x20d0
leaq 0x171c(%rip), %rsi      # 0x5117
leaq 0x10(%rsp), %rdi
callq 0x2190
movq %rax, %r14
leaq 0xc(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x1656(%rip), %rsi      # 0x5070
movq %rax, %rdi
xorl %eax, %eax
callq 0x2280
cmpl $0x1, %eax
jne 0x3af7
cmpl %ebp, 0xc(%rsp)
jne 0x3af7
testl %ebp, %ebp
jle 0x3a6b
leaq 0x1746(%rip), %r15      # 0x5188
xorl %r12d, %r12d
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2280
cmpl $0x1, %eax
jne 0x3a7b
incq %r12
movslq 0xc(%rsp), %rax
addq $0x8, %rbx
cmpq %rax, %r12
jl 0x3a45
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1b1f(%rip), %rdi      # 0x55a1
leaq 0x1acb(%rip), %rsi      # 0x5554
leaq 0x1ad6(%rip), %rcx      # 0x5566
movl $0xa5, %edx
callq 0x20d0
leaq 0x1b32(%rip), %rdi      # 0x55d3
leaq 0x1aac(%rip), %rsi      # 0x5554
leaq 0x1ab7(%rip), %rcx      # 0x5566
movl $0xb1, %edx
callq 0x20d0
leaq 0x1ae1(%rip), %rdi      # 0x55a1
leaq 0x1a8d(%rip), %rsi      # 0x5554
leaq 0x1a98(%rip), %rcx      # 0x5566
movl $0xac, %edx
callq 0x20d0
leaq 0x1ad2(%rip), %rdi      # 0x55b1
leaq 0x1a6e(%rip), %rsi      # 0x5554
leaq 0x1a79(%rip), %rcx      # 0x5566
movl $0xad, %edx
callq 0x20d0
leaq 0x1a34(%rip), %rdi      # 0x5532
leaq 0x1a4f(%rip), %rsi      # 0x5554
leaq 0x1a5a(%rip), %rcx      # 0x5566
movl $0xa2, %edx
callq 0x20d0