/*
 * FileManager.c
 *
 *  Created on: 06/12/2017
 *      Author: roussian
 */

#include "FileManager.cuh"
#include "FileLocation.cuh"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void readQuery(int* iTermNumber, float* dAverageDocLength,  int* iTopK,
			   int*** h_iDocIdList, int*** h_iLenghtList,  unsigned short int*** h_iFreqList,
			   float** h_dIdfList, float** h_dUBList, int** h_iDocNumberList, int experimentNumber){

//	printf("--------------------->");
//	printf("PATH: %s\n",INVERTED_LIST_FILE);

//	char experiment_number[] ="";
//	sprintf(experiment_number, "%d", experimentNumber);

	const char *fileName = INVERTED_LIST_FILE;

//	sprintf(fileName,INVERTED_LIST_FILE);
	//strncat(fileName, experiment_number,1);

	char line[100];
//	char* token;
	int sizeLine = 100;

	int i = 0;
	int count = 0;

	FILE *fp;

	char* result;
	fp = fopen(fileName,"r");

//	const char s[2] = " ";

	if (!fp) {
	  printf( "Where is the file?\n");
	  exit( EXIT_FAILURE);
	}

	result = fgets(line,sizeLine,fp);
	sscanf(line, "%d", iTermNumber);
	if(result == NULL) printf("Erro in FileManager!!!\n");

	//---------------1ª Part of the list allocation------------------------
	*h_iDocIdList = (int**) malloc(*iTermNumber * sizeof(int*));
	*h_iLenghtList = (int**) malloc(*iTermNumber * sizeof(int*));
	*h_iFreqList = (unsigned short**) malloc(*iTermNumber * sizeof(unsigned short int*));

	*h_dIdfList = (float*) malloc(*iTermNumber * sizeof(float));
	*h_dUBList  = (float*) malloc(*iTermNumber * sizeof(float));

	*h_iDocNumberList = (int*) malloc(*iTermNumber *sizeof(int));
	//------------------------------------------------------------------

	result = fgets(line,sizeLine,fp);
	sscanf(line, "%f", dAverageDocLength);

//	fgets(line,sizeLine,fp);
//	sscanf(line, "%d", iTopK);

	do{
		 result = fgets(line,sizeLine,fp);
		 sscanf(line, "%f", &((*h_dIdfList)[i]));

		 result = fgets(line,sizeLine,fp);
		 sscanf(line, "%f", &((*h_dUBList)[i]));

		 result = fgets(line,sizeLine,fp);
		 sscanf(line, "%d", &((*h_iDocNumberList)[i]));
//		 printf("#Doc no termo %i: %i. \n",i, (*h_iDocNumberList)[i]);

		 //---------------2ª Part of the list allocation------------------------
		 (*h_iDocIdList)[i] = (int*) malloc((*h_iDocNumberList)[i] * sizeof(int));
		 (*h_iLenghtList)[i] = (int*) malloc((*h_iDocNumberList)[i] * sizeof(int));
		 (*h_iFreqList)[i] = (unsigned short*) malloc((*h_iDocNumberList)[i] * sizeof(unsigned short));
		 //--------------------------------------------------------------------

		 result = fgets(line,sizeLine,fp);

		 count = 0;
		 while(*line != '-'){
			 sscanf(line,"%d %hu %d", &((*h_iDocIdList)[i][count]), &((*h_iFreqList)[i][count]), &((*h_iLenghtList)[i][count]));
			 result = fgets(line,sizeLine,fp);
			 count++;
		 }

//		 printf("Count no termo %i: %i. \n",i, count);
		 i++;
	}while ((!feof(fp)) && (i < *iTermNumber));

	fflush(fp);
	fclose(fp);
}

/*
 * Regra na construção do índice invertido: A posição do termo == A id do Termo
 */

void readInvertedList(int* iTermNumberInVocabulary, float* dAverageDocLength,
					  int*** h_iDocIdList, int*** h_iLenghtList,
					  unsigned short int*** h_iFreqList, float** h_dIdfList,
					  float** h_dUBList, int** h_iDocNumberList, unsigned long long* docTotalNumber){

	int i=0, numberReadPosting=0, sizeLine = 100;
//	char fileName[24] = INDEX_FILENAME, line[sizeLine];
	char fileName[100] = INVERTED_LIST_FILE, line[sizeLine];


	FILE *fp = fopen(fileName,"r");

	char* result;
	if (!fp) {
	  printf( "Where is the file of inverted list?\n");
	  exit( EXIT_FAILURE);
	}

	result = fgets(line,sizeLine,fp);
	sscanf(line, "%d", iTermNumberInVocabulary);

	if(result == NULL) printf("Erro in FileManager!!!\n");

	result = fgets(line,sizeLine,fp);
	sscanf(line, "%f", dAverageDocLength);

	//---------------1ª Part of the list allocation------------------------
	*h_iDocIdList = (int**) malloc(*iTermNumberInVocabulary * sizeof(int*));
	*h_iLenghtList = (int**) malloc(*iTermNumberInVocabulary * sizeof(int*));
	*h_iFreqList = (unsigned short**) malloc(*iTermNumberInVocabulary * sizeof(unsigned short int*));

	*h_dIdfList = (float*) malloc(*iTermNumberInVocabulary * sizeof(float));

	*h_dUBList  = (float*) malloc(*iTermNumberInVocabulary * sizeof(float));
	*h_iDocNumberList = (int*) malloc(*iTermNumberInVocabulary *sizeof(int));
	//------------------------------------------------------------------

	do{
		int idTerm;
		result = fgets(line,sizeLine,fp);
		sscanf(line, "%d", &idTerm);
		if(result == NULL) printf("Error in FileManager!!!\n");

		result = fgets(line,sizeLine,fp);
		sscanf(line, "%f", &((*h_dIdfList)[idTerm]));
		if(result == NULL) printf("Error in FileManager!!!\n");

		result = fgets(line,sizeLine,fp);
		sscanf(line, "%f", &((*h_dUBList)[idTerm]));
		if(result == NULL) printf("Error in FileManager!!!\n");

		result = fgets(line,sizeLine,fp);
		sscanf(line, "%d", &((*h_iDocNumberList)[idTerm]));
		if(result == NULL) printf("Error in FileManager!!!\n");

		*docTotalNumber += (*h_iDocNumberList)[idTerm];
		 //---------------2ª Part of the list allocation------------------------
		(*h_iDocIdList)[idTerm] = (int*) malloc((*h_iDocNumberList)[idTerm] * sizeof(int));
		(*h_iLenghtList)[idTerm] = (int*) malloc((*h_iDocNumberList)[idTerm] * sizeof(int));
		(*h_iFreqList)[idTerm] = (unsigned short*) malloc((*h_iDocNumberList)[idTerm] * sizeof(unsigned short));
		 //--------------------------------------------------------------------

		result = fgets(line,sizeLine,fp);

		numberReadPosting = 0;
		while(!feof(fp) && *line != '-' && line != NULL){
			sscanf(line,"%d %hu %d", &((*h_iDocIdList)[idTerm][numberReadPosting]), &((*h_iFreqList)[idTerm][numberReadPosting]), &((*h_iLenghtList)[idTerm][numberReadPosting]));
			result = fgets(line,sizeLine,fp);
			numberReadPosting++;
		}
		i++;
	}while ((!feof(fp)) && (i < *iTermNumberInVocabulary));

	fflush(fp);
	fclose(fp);
}

/*
 * Faz a leitura do batch da query e armazena na queryBatch.
 * Esse método precisa melhorar no futuro, pois faz a leitura de forma primitiva.
 */
void readQueryBatch(int ***queryBatch, int *queryNumber, int **h_iTermNumberList){

	char fileName[32] = QUERY_BATCH_TRANSCRIPT;
	FILE *fp;
	char* result;
	int sizeLine = 100;
	char *linePtr = (char *) malloc(sizeLine * sizeof(char));//[sizeLine];
	char *line = linePtr, *saveptr, *token;

	int idQuery=0, queryIdTerm, indexTerm, termNumberByQuery;

	fp = fopen(fileName,"r");
	if (!fp) {
	  printf( "Where is the file of query batch?\n");
	  exit( EXIT_FAILURE);
	}
	result = fgets(line,sizeLine,fp);
	if(result == NULL) printf("Error in FileManager!!!\n");

	*queryBatch = (int**) malloc(*queryNumber * sizeof(int*));
	*h_iTermNumberList = (int*) malloc(*queryNumber * sizeof(int*));
	do {
		indexTerm = 0;
		termNumberByQuery = 1;
		//Faz a leitura da query considerando que há espaço a cada idTerm
		for (int i = 0; line[i] != '\0'; ++i) {
	       if(line[i] == ' ')
	           termNumberByQuery++;
		}
		(*h_iTermNumberList)[idQuery] = termNumberByQuery;
		(*queryBatch)[idQuery] = (int*) malloc(termNumberByQuery * sizeof(int));

		do {
			token = strtok_r(line, QUERY_DELIMITER, &saveptr);
			sscanf(token, "%d", &queryIdTerm);

			(*queryBatch)[idQuery][indexTerm]  = queryIdTerm;
			indexTerm++;
			line = NULL;
		} while (indexTerm < termNumberByQuery);

		line = linePtr;
		result = fgets(line,sizeLine,fp);
		idQuery++;

	}while ( (!feof(fp)) && (line != NULL) && (idQuery < *queryNumber) );

	free(linePtr);
//	*queryNumber = idQuery;
}

	.file	"tmpxft_0031ac5c_00000000-6_FileManager.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2032:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2032:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"r"
.LC1:
	.string	"../input/postingsquery_"
.LC2:
	.string	"Where is the file?\n"
.LC3:
	.string	"%d"
.LC4:
	.string	"Erro in FileManager!!!\n"
.LC5:
	.string	"%f"
.LC6:
	.string	"%d %hu %d"
	.text
	.globl	_Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i
	.type	_Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i, @function
_Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r9, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	leaq	.LC0(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	leaq	.LC1(%rip), %rdi
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	224(%rsp), %rax
	movq	%rcx, 16(%rsp)
	movq	%r8, 24(%rsp)
	movq	240(%rsp), %r14
	movq	%rax, 32(%rsp)
	movq	232(%rsp), %rax
	movq	%rax, 40(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	call	fopen@PLT
	movq	%rax, (%rsp)
	testq	%rax, %rax
	jne	.L3
	movl	$2, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L3:
	leaq	52(%rsp), %rbp
	movq	(%rsp), %rcx
	movl	$100, %edx
	movl	$100, %esi
	movq	%rbp, %rdi
	call	__fgets_chk@PLT
	movq	%rbx, %rdx
	leaq	.LC3(%rip), %rsi
	movq	%rbp, %rdi
	movq	%rax, %r15
	xorl	%eax, %eax
	call	__isoc23_sscanf@PLT
	testq	%r15, %r15
	jne	.L4
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L4:
	movslq	(%rbx), %rdi
	salq	$3, %rdi
	call	malloc@PLT
	movq	16(%rsp), %rcx
	movslq	(%rbx), %rdi
	movq	%rax, (%rcx)
	salq	$3, %rdi
	call	malloc@PLT
	movq	24(%rsp), %rcx
	movslq	(%rbx), %rdi
	movq	%rax, (%rcx)
	salq	$3, %rdi
	call	malloc@PLT
	movslq	(%rbx), %rdi
	movq	%rax, 0(%r13)
	salq	$2, %rdi
	call	malloc@PLT
	movq	32(%rsp), %rcx
	movslq	(%rbx), %rdi
	movq	%rax, (%rcx)
	salq	$2, %rdi
	call	malloc@PLT
	movq	40(%rsp), %rcx
	movslq	(%rbx), %rdi
	movq	%rax, (%rcx)
	salq	$2, %rdi
	call	malloc@PLT
	movq	(%rsp), %rcx
	movq	%rbp, %rdi
	movl	$100, %edx
	movq	%rax, (%r14)
	movl	$100, %esi
	call	__fgets_chk@PLT
	movq	%rbp, %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rsi
	xorl	%ebp, %ebp
	call	__isoc23_sscanf@PLT
.L8:
	movq	(%rsp), %rcx
	leaq	52(%rsp), %rax
	movl	$100, %edx
	movl	$100, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	leaq	0(,%rbp,4), %r12
	call	__fgets_chk@PLT
	movq	32(%rsp), %rax
	movq	8(%rsp), %rdi
	leaq	.LC5(%rip), %rsi
	movq	(%rax), %rdx
	xorl	%eax, %eax
	addq	%r12, %rdx
	call	__isoc23_sscanf@PLT
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdi
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	movq	40(%rsp), %rax
	movq	8(%rsp), %rdi
	leaq	.LC5(%rip), %rsi
	movq	(%rax), %rdx
	xorl	%eax, %eax
	addq	%r12, %rdx
	call	__isoc23_sscanf@PLT
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdi
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	movq	(%r14), %rdx
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	addq	%r12, %rdx
	leaq	0(,%rbp,8), %r12
	call	__isoc23_sscanf@PLT
	movq	16(%rsp), %rax
	movq	(%rax), %r15
	movq	(%r14), %rax
	movslq	(%rax,%rbp,4), %rdi
	addq	%r12, %r15
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, (%r15)
	movq	24(%rsp), %rax
	movq	(%rax), %r15
	movq	(%r14), %rax
	movslq	(%rax,%rbp,4), %rdi
	addq	%r12, %r15
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, (%r15)
	movq	(%r14), %rax
	movq	0(%r13), %r15
	movslq	(%rax,%rbp,4), %rdi
	addq	%r12, %r15
	addq	%rdi, %rdi
	call	malloc@PLT
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdi
	movl	$100, %edx
	movq	%rax, (%r15)
	movl	$100, %esi
	xorl	%r15d, %r15d
	call	__fgets_chk@PLT
.L5:
	cmpb	$45, 52(%rsp)
	je	.L13
	movq	0(%r13), %rdx
	movq	16(%rsp), %rsi
	leaq	(%r15,%r15), %r8
	leaq	52(%rsp), %rdi
	movq	24(%rsp), %rax
	movq	%rdi, 8(%rsp)
	movq	(%rdx,%r12), %rcx
	movq	(%rsi), %rdx
	movq	(%rax), %rax
	movq	(%rdx,%r12), %rsi
	addq	%r15, %rcx
	addq	$2, %r15
	addq	%r8, %rsi
	addq	(%rax,%r12), %r8
	xorl	%eax, %eax
	movq	%rsi, %rdx
	leaq	.LC6(%rip), %rsi
	call	__isoc23_sscanf@PLT
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdi
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	jmp	.L5
.L13:
	movq	(%rsp), %rdi
	call	feof@PLT
	testl	%eax, %eax
	jne	.L7
	incq	%rbp
	cmpl	%ebp, (%rbx)
	jg	.L8
.L7:
	movq	(%rsp), %rdi
	call	fflush@PLT
	movq	(%rsp), %rdi
	call	fclose@PLT
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	addq	$168, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i, .-_Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i
	.section	.rodata.str1.1
.LC7:
	.string	"Where is the file of inverted list?\n"
.LC8:
	.string	"Error in FileManager!!!\n"
	.text
	.globl	_Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py
	.type	_Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py, @function
_Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdx, %r15
	movabsq	$7453010382218555439, %rdx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r8, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rcx, %rbp
	movl	$17, %ecx
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	subq	$296, %rsp
	.cfi_def_cfa_offset 352
	movq	352(%rsp), %rax
	movq	%rsi, 16(%rsp)
	leaq	212(%rsp), %rdi
	leaq	.LC0(%rip), %rsi
	movq	%r9, 24(%rsp)
	movq	360(%rsp), %r13
	movq	%rax, 32(%rsp)
	movq	368(%rsp), %rax
	movq	%rax, 48(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 280(%rsp)
	movabsq	$8391737100188200494, %rax
	movq	%rdx, 188(%rsp)
	xorl	%edx, %edx
	movq	%rdx, 204(%rsp)
	movq	%rax, 180(%rsp)
	movabsq	$26873655022940531, %rax
	movq	%rax, 196(%rsp)
	xorl	%eax, %eax
	rep stosl
	leaq	180(%rsp), %rdi
	call	fopen@PLT
	movq	%rax, (%rsp)
	testq	%rax, %rax
	jne	.L15
	movl	$2, %edi
	leaq	.LC7(%rip), %rsi
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L15:
	leaq	80(%rsp), %rax
	movq	(%rsp), %rcx
	movl	$100, %edx
	movl	$100, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	__fgets_chk@PLT
	movq	8(%rsp), %rdi
	movq	%rbx, %rdx
	leaq	.LC3(%rip), %rsi
	movq	%rax, %r14
	xorl	%eax, %eax
	call	__isoc23_sscanf@PLT
	testq	%r14, %r14
	jne	.L16
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdi
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	movq	16(%rsp), %rdx
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rsi
	call	__isoc23_sscanf@PLT
	movslq	(%rbx), %rdi
	salq	$3, %rdi
	call	malloc@PLT
	movslq	(%rbx), %rdi
	movq	%rax, (%r15)
	salq	$3, %rdi
	call	malloc@PLT
	movslq	(%rbx), %rdi
	movq	%rax, 0(%rbp)
	salq	$3, %rdi
	call	malloc@PLT
	movslq	(%rbx), %rdi
	movq	%rax, (%r12)
	salq	$2, %rdi
	call	malloc@PLT
	movq	24(%rsp), %rcx
	movslq	(%rbx), %rdi
	movq	%rax, (%rcx)
	salq	$2, %rdi
	call	malloc@PLT
	movq	32(%rsp), %rcx
	movslq	(%rbx), %rdi
	movq	%rax, (%rcx)
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, 0(%r13)
	xorl	%eax, %eax
	movl	%eax, 16(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 8(%rsp)
.L24:
	movq	8(%rsp), %rdi
	movq	(%rsp), %rcx
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	movq	8(%rsp), %rdi
	leaq	76(%rsp), %rdx
	leaq	.LC3(%rip), %rsi
	movq	%rax, %r14
	xorl	%eax, %eax
	call	__isoc23_sscanf@PLT
	testq	%r14, %r14
	jne	.L17
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L17:
	movq	8(%rsp), %rdi
	movq	(%rsp), %rcx
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	movslq	76(%rsp), %rdx
	movq	8(%rsp), %rdi
	leaq	.LC5(%rip), %rsi
	movq	%rax, %r14
	movq	24(%rsp), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rdx,4), %rdx
	xorl	%eax, %eax
	call	__isoc23_sscanf@PLT
	testq	%r14, %r14
	jne	.L18
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L18:
	movq	8(%rsp), %rdi
	movq	(%rsp), %rcx
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	movslq	76(%rsp), %rdx
	movq	8(%rsp), %rdi
	leaq	.LC5(%rip), %rsi
	movq	%rax, %r14
	movq	32(%rsp), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rdx,4), %rdx
	xorl	%eax, %eax
	call	__isoc23_sscanf@PLT
	testq	%r14, %r14
	jne	.L19
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L19:
	movq	8(%rsp), %rdi
	movq	(%rsp), %rcx
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	movslq	76(%rsp), %rdx
	movq	8(%rsp), %rdi
	leaq	.LC3(%rip), %rsi
	movq	%rax, %r14
	movq	0(%r13), %rax
	leaq	(%rax,%rdx,4), %rdx
	xorl	%eax, %eax
	call	__isoc23_sscanf@PLT
	testq	%r14, %r14
	jne	.L20
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L20:
	movslq	76(%rsp), %rcx
	movq	0(%r13), %rax
	movslq	(%rax,%rcx,4), %rdi
	movq	48(%rsp), %rax
	movq	%rcx, 56(%rsp)
	leaq	0(,%rcx,8), %r14
	addq	%rdi, (%rax)
	movq	(%r15), %rax
	salq	$2, %rdi
	addq	%r14, %rax
	movq	%rax, 40(%rsp)
	call	malloc@PLT
	movq	40(%rsp), %rcx
	movq	%rax, (%rcx)
	movq	0(%rbp), %rax
	movq	56(%rsp), %rcx
	addq	%r14, %rax
	movq	%rax, 40(%rsp)
	movq	0(%r13), %rax
	movslq	(%rax,%rcx,4), %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	40(%rsp), %rcx
	addq	(%r12), %r14
	movq	%rax, (%rcx)
	movq	56(%rsp), %rcx
	movq	0(%r13), %rax
	movslq	(%rax,%rcx,4), %rdi
	addq	%rdi, %rdi
	call	malloc@PLT
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdi
	movl	$100, %edx
	movq	%rax, (%r14)
	movl	$100, %esi
	xorl	%r14d, %r14d
	call	__fgets_chk@PLT
.L22:
	movq	(%rsp), %rdi
	call	feof@PLT
	testl	%eax, %eax
	jne	.L21
	cmpb	$45, 80(%rsp)
	je	.L21
	movslq	76(%rsp), %rax
	movq	(%r12), %rdx
	leaq	(%r14,%r14), %r8
	movq	0(%rbp), %rsi
	movq	(%rdx,%rax,8), %rcx
	movq	(%r15), %rdx
	movq	(%rdx,%rax,8), %rdi
	addq	%r14, %rcx
	addq	$2, %r14
	addq	%r8, %rdi
	addq	(%rsi,%rax,8), %r8
	leaq	.LC6(%rip), %rsi
	xorl	%eax, %eax
	movq	%rdi, %rdx
	movq	8(%rsp), %rdi
	call	__isoc23_sscanf@PLT
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdi
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	jmp	.L22
.L21:
	movq	(%rsp), %rdi
	call	feof@PLT
	testl	%eax, %eax
	jne	.L23
	incl	16(%rsp)
	movl	16(%rsp), %eax
	cmpl	%eax, (%rbx)
	jg	.L24
.L23:
	movq	(%rsp), %rdi
	call	fflush@PLT
	movq	(%rsp), %rdi
	call	fclose@PLT
	movq	280(%rsp), %rax
	subq	%fs:40, %rax
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	addq	$296, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py, .-_Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py
	.section	.rodata.str1.1
.LC9:
	.string	"Where is the file of query batch?\n"
.LC10:
	.string	" "
	.text
	.globl	_Z14readQueryBatchPPPiS_S0_
	.type	_Z14readQueryBatchPPPiS_S0_, @function
_Z14readQueryBatchPPPiS_S0_:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	movabsq	$7021802515971664991, %rdx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdi, %r13
	movl	$100, %edi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	movabsq	$8751168581018791470, %rax
	movq	%rdx, 64(%rsp)
	movabsq	$13615774097044849, %rdx
	movq	%rdx, 80(%rsp)
	movq	%rax, 56(%rsp)
	movabsq	$6878246129094587246, %rax
	movq	%rax, 72(%rsp)
	call	malloc@PLT
	leaq	56(%rsp), %rdi
	leaq	.LC0(%rip), %rsi
	movq	%rax, 8(%rsp)
	call	fopen@PLT
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L29
	movl	$2, %edi
	leaq	.LC9(%rip), %rsi
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L29:
	movq	16(%rsp), %rcx
	movq	8(%rsp), %rdi
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	testq	%rax, %rax
	jne	.L30
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
.L30:
	movslq	(%r12), %rdi
	xorl	%ebp, %ebp
	salq	$3, %rdi
	call	malloc@PLT
	movslq	(%r12), %rdi
	movq	%rax, 0(%r13)
	salq	$3, %rdi
	call	malloc@PLT
	movq	%rax, (%r14)
.L36:
	movq	8(%rsp), %rax
	movl	$1, %ebx
.L31:
	movb	(%rax), %dl
	testb	%dl, %dl
	je	.L48
	cmpb	$32, %dl
	jne	.L32
	incl	%ebx
.L32:
	incq	%rax
	jmp	.L31
.L48:
	movq	(%r14), %rax
	leaq	0(,%rbp,8), %r15
	movslq	%ebx, %rdi
	salq	$2, %rdi
	movl	%ebx, (%rax,%rbp,4)
	movq	0(%r13), %rax
	addq	%r15, %rax
	movq	%rax, 24(%rsp)
	call	malloc@PLT
	movq	24(%rsp), %rcx
	movq	8(%rsp), %rdi
	xorl	%r8d, %r8d
	movq	%rax, (%rcx)
.L34:
	leaq	48(%rsp), %rdx
	leaq	.LC10(%rip), %rsi
	movq	%r8, 24(%rsp)
	call	strtok_r@PLT
	leaq	44(%rsp), %rdx
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdi
	xorl	%eax, %eax
	call	__isoc23_sscanf@PLT
	movq	0(%r13), %rax
	movq	24(%rsp), %r8
	xorl	%edi, %edi
	movl	44(%rsp), %edx
	movq	(%rax,%r15), %rax
	movl	%edx, (%rax,%r8,4)
	incq	%r8
	cmpl	%r8d, %ebx
	jg	.L34
	movq	16(%rsp), %rcx
	movq	8(%rsp), %rdi
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	movq	16(%rsp), %rdi
	call	feof@PLT
	cmpq	$0, 8(%rsp)
	je	.L35
	testl	%eax, %eax
	jne	.L35
	incq	%rbp
	cmpl	%ebp, (%r12)
	jg	.L36
.L35:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	movq	8(%rsp), %rdi
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE2029:
	.size	_Z14readQueryBatchPPPiS_S0_, .-_Z14readQueryBatchPPPiS_S0_
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2055:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2055:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

/*
 * FileManager.c
 *
 *  Created on: 06/12/2017
 *      Author: roussian
 */


#include <hip/hip_runtime.h>
#include "FileManager.cuh"
#include "FileLocation.cuh"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void readQuery(int* iTermNumber, float* dAverageDocLength,  int* iTopK,
			   int*** h_iDocIdList, int*** h_iLenghtList,  unsigned short int*** h_iFreqList,
			   float** h_dIdfList, float** h_dUBList, int** h_iDocNumberList, int experimentNumber){

//	printf("--------------------->");
//	printf("PATH: %s\n",INVERTED_LIST_FILE);

//	char experiment_number[] ="";
//	sprintf(experiment_number, "%d", experimentNumber);

	const char *fileName = INVERTED_LIST_FILE;

//	sprintf(fileName,INVERTED_LIST_FILE);
	//strncat(fileName, experiment_number,1);

	char line[100];
//	char* token;
	int sizeLine = 100;

	int i = 0;
	int count = 0;

	FILE *fp;

	char* result;
	fp = fopen(fileName,"r");

//	const char s[2] = " ";

	if (!fp) {
	  printf( "Where is the file?\n");
	  exit( EXIT_FAILURE);
	}

	result = fgets(line,sizeLine,fp);
	sscanf(line, "%d", iTermNumber);
	if(result == NULL) printf("Erro in FileManager!!!\n");

	//---------------1ª Part of the list allocation------------------------
	*h_iDocIdList = (int**) malloc(*iTermNumber * sizeof(int*));
	*h_iLenghtList = (int**) malloc(*iTermNumber * sizeof(int*));
	*h_iFreqList = (unsigned short**) malloc(*iTermNumber * sizeof(unsigned short int*));

	*h_dIdfList = (float*) malloc(*iTermNumber * sizeof(float));
	*h_dUBList  = (float*) malloc(*iTermNumber * sizeof(float));

	*h_iDocNumberList = (int*) malloc(*iTermNumber *sizeof(int));
	//------------------------------------------------------------------

	result = fgets(line,sizeLine,fp);
	sscanf(line, "%f", dAverageDocLength);

//	fgets(line,sizeLine,fp);
//	sscanf(line, "%d", iTopK);

	do{
		 result = fgets(line,sizeLine,fp);
		 sscanf(line, "%f", &((*h_dIdfList)[i]));

		 result = fgets(line,sizeLine,fp);
		 sscanf(line, "%f", &((*h_dUBList)[i]));

		 result = fgets(line,sizeLine,fp);
		 sscanf(line, "%d", &((*h_iDocNumberList)[i]));
//		 printf("#Doc no termo %i: %i. \n",i, (*h_iDocNumberList)[i]);

		 //---------------2ª Part of the list allocation------------------------
		 (*h_iDocIdList)[i] = (int*) malloc((*h_iDocNumberList)[i] * sizeof(int));
		 (*h_iLenghtList)[i] = (int*) malloc((*h_iDocNumberList)[i] * sizeof(int));
		 (*h_iFreqList)[i] = (unsigned short*) malloc((*h_iDocNumberList)[i] * sizeof(unsigned short));
		 //--------------------------------------------------------------------

		 result = fgets(line,sizeLine,fp);

		 count = 0;
		 while(*line != '-'){
			 sscanf(line,"%d %hu %d", &((*h_iDocIdList)[i][count]), &((*h_iFreqList)[i][count]), &((*h_iLenghtList)[i][count]));
			 result = fgets(line,sizeLine,fp);
			 count++;
		 }

//		 printf("Count no termo %i: %i. \n",i, count);
		 i++;
	}while ((!feof(fp)) && (i < *iTermNumber));

	fflush(fp);
	fclose(fp);
}

/*
 * Regra na construção do índice invertido: A posição do termo == A id do Termo
 */

void readInvertedList(int* iTermNumberInVocabulary, float* dAverageDocLength,
					  int*** h_iDocIdList, int*** h_iLenghtList,
					  unsigned short int*** h_iFreqList, float** h_dIdfList,
					  float** h_dUBList, int** h_iDocNumberList, unsigned long long* docTotalNumber){

	int i=0, numberReadPosting=0, sizeLine = 100;
//	char fileName[24] = INDEX_FILENAME, line[sizeLine];
	char fileName[100] = INVERTED_LIST_FILE, line[sizeLine];


	FILE *fp = fopen(fileName,"r");

	char* result;
	if (!fp) {
	  printf( "Where is the file of inverted list?\n");
	  exit( EXIT_FAILURE);
	}

	result = fgets(line,sizeLine,fp);
	sscanf(line, "%d", iTermNumberInVocabulary);

	if(result == NULL) printf("Erro in FileManager!!!\n");

	result = fgets(line,sizeLine,fp);
	sscanf(line, "%f", dAverageDocLength);

	//---------------1ª Part of the list allocation------------------------
	*h_iDocIdList = (int**) malloc(*iTermNumberInVocabulary * sizeof(int*));
	*h_iLenghtList = (int**) malloc(*iTermNumberInVocabulary * sizeof(int*));
	*h_iFreqList = (unsigned short**) malloc(*iTermNumberInVocabulary * sizeof(unsigned short int*));

	*h_dIdfList = (float*) malloc(*iTermNumberInVocabulary * sizeof(float));

	*h_dUBList  = (float*) malloc(*iTermNumberInVocabulary * sizeof(float));
	*h_iDocNumberList = (int*) malloc(*iTermNumberInVocabulary *sizeof(int));
	//------------------------------------------------------------------

	do{
		int idTerm;
		result = fgets(line,sizeLine,fp);
		sscanf(line, "%d", &idTerm);
		if(result == NULL) printf("Error in FileManager!!!\n");

		result = fgets(line,sizeLine,fp);
		sscanf(line, "%f", &((*h_dIdfList)[idTerm]));
		if(result == NULL) printf("Error in FileManager!!!\n");

		result = fgets(line,sizeLine,fp);
		sscanf(line, "%f", &((*h_dUBList)[idTerm]));
		if(result == NULL) printf("Error in FileManager!!!\n");

		result = fgets(line,sizeLine,fp);
		sscanf(line, "%d", &((*h_iDocNumberList)[idTerm]));
		if(result == NULL) printf("Error in FileManager!!!\n");

		*docTotalNumber += (*h_iDocNumberList)[idTerm];
		 //---------------2ª Part of the list allocation------------------------
		(*h_iDocIdList)[idTerm] = (int*) malloc((*h_iDocNumberList)[idTerm] * sizeof(int));
		(*h_iLenghtList)[idTerm] = (int*) malloc((*h_iDocNumberList)[idTerm] * sizeof(int));
		(*h_iFreqList)[idTerm] = (unsigned short*) malloc((*h_iDocNumberList)[idTerm] * sizeof(unsigned short));
		 //--------------------------------------------------------------------

		result = fgets(line,sizeLine,fp);

		numberReadPosting = 0;
		while(!feof(fp) && *line != '-' && line != NULL){
			sscanf(line,"%d %hu %d", &((*h_iDocIdList)[idTerm][numberReadPosting]), &((*h_iFreqList)[idTerm][numberReadPosting]), &((*h_iLenghtList)[idTerm][numberReadPosting]));
			result = fgets(line,sizeLine,fp);
			numberReadPosting++;
		}
		i++;
	}while ((!feof(fp)) && (i < *iTermNumberInVocabulary));

	fflush(fp);
	fclose(fp);
}

/*
 * Faz a leitura do batch da query e armazena na queryBatch.
 * Esse método precisa melhorar no futuro, pois faz a leitura de forma primitiva.
 */
void readQueryBatch(int ***queryBatch, int *queryNumber, int **h_iTermNumberList){

	char fileName[32] = QUERY_BATCH_TRANSCRIPT;
	FILE *fp;
	char* result;
	int sizeLine = 100;
	char *linePtr = (char *) malloc(sizeLine * sizeof(char));//[sizeLine];
	char *line = linePtr, *saveptr, *token;

	int idQuery=0, queryIdTerm, indexTerm, termNumberByQuery;

	fp = fopen(fileName,"r");
	if (!fp) {
	  printf( "Where is the file of query batch?\n");
	  exit( EXIT_FAILURE);
	}
	result = fgets(line,sizeLine,fp);
	if(result == NULL) printf("Error in FileManager!!!\n");

	*queryBatch = (int**) malloc(*queryNumber * sizeof(int*));
	*h_iTermNumberList = (int*) malloc(*queryNumber * sizeof(int*));
	do {
		indexTerm = 0;
		termNumberByQuery = 1;
		//Faz a leitura da query considerando que há espaço a cada idTerm
		for (int i = 0; line[i] != '\0'; ++i) {
	       if(line[i] == ' ')
	           termNumberByQuery++;
		}
		(*h_iTermNumberList)[idQuery] = termNumberByQuery;
		(*queryBatch)[idQuery] = (int*) malloc(termNumberByQuery * sizeof(int));

		do {
			token = strtok_r(line, QUERY_DELIMITER, &saveptr);
			sscanf(token, "%d", &queryIdTerm);

			(*queryBatch)[idQuery][indexTerm]  = queryIdTerm;
			indexTerm++;
			line = NULL;
		} while (indexTerm < termNumberByQuery);

		line = linePtr;
		result = fgets(line,sizeLine,fp);
		idQuery++;

	}while ( (!feof(fp)) && (line != NULL) && (idQuery < *queryNumber) );

	free(linePtr);
//	*queryNumber = idQuery;
}

	.text
	.file	"FileManager.hip"
	.globl	_Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i # -- Begin function _Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i
	.type	_Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i,@function
_Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i: # @_Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, 16(%rsp)                   # 8-byte Spill
	movq	%r8, %r15
	movq	%rcx, %r13
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB0_10
# %bb.1:
	movq	%rax, %rbp
	movq	%r15, 8(%rsp)                   # 8-byte Spill
	movq	%r14, 32(%rsp)                  # 8-byte Spill
	movq	216(%rsp), %r14
	leaq	48(%rsp), %r12
	movq	%r12, %rdi
	movl	$100, %esi
	movq	%rax, %rdx
	callq	fgets
	movq	%rbp, (%rsp)                    # 8-byte Spill
	movq	%rax, %rbp
	movl	$.L.str.3, %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	testq	%rbp, %rbp
	jne	.LBB0_3
# %bb.2:
	movl	$.Lstr.3, %edi
	callq	puts@PLT
.LBB0_3:
	movq	%rbx, 40(%rsp)                  # 8-byte Spill
	movslq	(%rbx), %r12
	leaq	(,%r12,8), %rbp
	movq	%rbp, %rdi
	callq	malloc
	movq	%r13, %r15
	movq	%rax, (%r13)
	movq	%rbp, %rdi
	callq	malloc
	movq	8(%rsp), %rcx                   # 8-byte Reload
	movq	%rax, (%rcx)
	movq	%rbp, %rdi
	callq	malloc
	movq	16(%rsp), %rcx                  # 8-byte Reload
	movq	%rax, (%rcx)
	shlq	$2, %r12
	movq	%r12, %rdi
	callq	malloc
	movq	208(%rsp), %rcx
	movq	%rax, (%rcx)
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, (%r14)
	movq	%r12, %rdi
	callq	malloc
	movq	224(%rsp), %rcx
	movq	%rax, (%rcx)
	leaq	48(%rsp), %r13
	movq	%r13, %rdi
	movl	$100, %esi
	movq	(%rsp), %rbp                    # 8-byte Reload
	movq	%rbp, %rdx
	callq	fgets
	movl	$.L.str.5, %esi
	movq	%r13, %rdi
	movq	32(%rsp), %rdx                  # 8-byte Reload
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	xorl	%ebx, %ebx
	movq	%r15, 24(%rsp)                  # 8-byte Spill
.LBB0_4:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_6 Depth 2
	movq	%r13, %rdi
	movl	$100, %esi
	movq	%rbp, %rdx
	callq	fgets
	leaq	(,%rbx,4), %r12
	movq	208(%rsp), %rax
	movq	(%rax), %rdx
	addq	%r12, %rdx
	movl	$.L.str.5, %esi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	movq	%r13, %rdi
	movl	$100, %esi
	movq	%rbp, %rdx
	callq	fgets
	movq	(%r14), %rdx
	addq	%r12, %rdx
	movl	$.L.str.5, %esi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	movq	%r13, %rdi
	movl	$100, %esi
	movq	%rbp, %rdx
	callq	fgets
	movq	224(%rsp), %r14
	addq	(%r14), %r12
	movl	$.L.str.3, %esi
	movq	%r13, %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	movq	(%r14), %rax
	movslq	(%rax,%rbx,4), %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	(%r14), %rax
	movslq	(%rax,%rbx,4), %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	8(%rsp), %r15                   # 8-byte Reload
	movq	(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	(%r14), %rax
	movslq	(%rax,%rbx,4), %rdi
	addq	%rdi, %rdi
	callq	malloc
	movq	16(%rsp), %r14                  # 8-byte Reload
	movq	(%r14), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	%r13, %rdi
	movl	$100, %esi
	movq	%rbp, %rdx
	callq	fgets
	cmpb	$45, 48(%rsp)
	je	.LBB0_7
# %bb.5:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rbp
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
.LBB0_6:                                # %.lr.ph
                                        #   Parent Loop BB0_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	24(%rsp), %rax                  # 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax,%rbx,8), %rdx
	addq	%r14, %rdx
	movq	(%rbp), %rax
	movq	(%rax,%rbx,8), %rcx
	addq	%r12, %rcx
	movq	(%r15), %rax
	movq	(%rax,%rbx,8), %r8
	addq	%r14, %r8
	movl	$.L.str.6, %esi
	leaq	48(%rsp), %r13
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	movq	%r13, %rdi
	movl	$100, %esi
	movq	(%rsp), %rdx                    # 8-byte Reload
	callq	fgets
	addq	$4, %r14
	addq	$2, %r12
	cmpb	$45, 48(%rsp)
	jne	.LBB0_6
.LBB0_7:                                # %._crit_edge
                                        #   in Loop: Header=BB0_4 Depth=1
	movq	(%rsp), %rbp                    # 8-byte Reload
	movq	%rbp, %rdi
	callq	feof
	testl	%eax, %eax
	movq	24(%rsp), %r15                  # 8-byte Reload
	movq	216(%rsp), %r14
	leaq	48(%rsp), %r13
	jne	.LBB0_9
# %bb.8:                                #   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movq	40(%rsp), %rax                  # 8-byte Reload
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	.LBB0_4
.LBB0_9:                                # %.critedge
	movq	%rbp, %rdi
	callq	fflush
	movq	%rbp, %rdi
	callq	fclose
	addq	$152, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB0_10:
	.cfi_def_cfa_offset 208
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$1, %edi
	callq	exit
.Lfunc_end0:
	.size	_Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i, .Lfunc_end0-_Z9readQueryPiPfS_PPS_S2_PPPtPS0_S6_S1_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py # -- Begin function _Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py
	.type	_Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py,@function
_Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py: # @_Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, 32(%rsp)                   # 8-byte Spill
	movq	%r8, 24(%rsp)                   # 8-byte Spill
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, 16(%rsp)                  # 8-byte Spill
	movq	%rdi, %r14
	movl	$.L__const._Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py.fileName, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB1_20
# %bb.1:
	movq	%rax, %rbp
	leaq	48(%rsp), %rbx
	movq	%rbx, %rdi
	movl	$100, %esi
	movq	%rax, %rdx
	callq	fgets
	movq	%rax, %r13
	movl	$.L.str.3, %esi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	testq	%r13, %r13
	jne	.LBB1_3
# %bb.2:
	movl	$.Lstr.3, %edi
	callq	puts@PLT
.LBB1_3:
	leaq	48(%rsp), %rbx
	movq	%rbx, %rdi
	movl	$100, %esi
	movq	%rbp, %rdx
	callq	fgets
	movl	$.L.str.5, %esi
	movq	%rbx, %rdi
	movq	16(%rsp), %rdx                  # 8-byte Reload
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	movslq	(%r14), %r13
	leaq	(,%r13,8), %rdi
	movq	%rdi, 16(%rsp)                  # 8-byte Spill
	callq	malloc
	movq	%rax, (%r12)
	movq	16(%rsp), %rdi                  # 8-byte Reload
	callq	malloc
	movq	%rax, (%r15)
	movq	16(%rsp), %rdi                  # 8-byte Reload
	callq	malloc
	movq	24(%rsp), %rcx                  # 8-byte Reload
	movq	%rax, (%rcx)
	shlq	$2, %r13
	movq	%r13, %rdi
	callq	malloc
	movq	32(%rsp), %rcx                  # 8-byte Reload
	movq	%rax, (%rcx)
	movq	%r13, %rdi
	callq	malloc
	movq	208(%rsp), %rcx
	movq	%rax, (%rcx)
	movq	%r13, %rdi
	callq	malloc
	movq	216(%rsp), %rcx
	movq	%rax, (%rcx)
	xorl	%eax, %eax
	movq	%r14, 40(%rsp)                  # 8-byte Spill
.LBB1_4:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_15 Depth 2
	movl	%eax, 16(%rsp)                  # 4-byte Spill
	movq	%rbx, %rdi
	movl	$100, %esi
	movq	%rbp, %rdx
	callq	fgets
	movq	%rax, %r13
	movl	$.L.str.3, %esi
	movq	%rbx, %rdi
	leaq	12(%rsp), %rdx
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	testq	%r13, %r13
	jne	.LBB1_6
# %bb.5:                                #   in Loop: Header=BB1_4 Depth=1
	movl	$.Lstr.9, %edi
	callq	puts@PLT
.LBB1_6:                                #   in Loop: Header=BB1_4 Depth=1
	movq	%rbx, %rdi
	movl	$100, %esi
	movq	%rbp, %rdx
	callq	fgets
	movq	%rax, %r13
	movslq	12(%rsp), %rdx
	shlq	$2, %rdx
	movq	32(%rsp), %rax                  # 8-byte Reload
	addq	(%rax), %rdx
	movl	$.L.str.5, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	testq	%r13, %r13
	jne	.LBB1_8
# %bb.7:                                #   in Loop: Header=BB1_4 Depth=1
	movl	$.Lstr.9, %edi
	callq	puts@PLT
.LBB1_8:                                #   in Loop: Header=BB1_4 Depth=1
	movq	%rbx, %rdi
	movl	$100, %esi
	movq	%rbp, %rdx
	callq	fgets
	movq	%rax, %r13
	movslq	12(%rsp), %rdx
	shlq	$2, %rdx
	movq	208(%rsp), %rax
	addq	(%rax), %rdx
	movl	$.L.str.5, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	testq	%r13, %r13
	jne	.LBB1_10
# %bb.9:                                #   in Loop: Header=BB1_4 Depth=1
	movl	$.Lstr.9, %edi
	callq	puts@PLT
.LBB1_10:                               #   in Loop: Header=BB1_4 Depth=1
	movq	%rbx, %rdi
	movl	$100, %esi
	movq	%rbp, %rdx
	callq	fgets
	movq	%rax, %r13
	movslq	12(%rsp), %rdx
	shlq	$2, %rdx
	movq	216(%rsp), %r14
	addq	(%r14), %rdx
	movl	$.L.str.3, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	testq	%r13, %r13
	jne	.LBB1_12
# %bb.11:                               #   in Loop: Header=BB1_4 Depth=1
	movl	$.Lstr.9, %edi
	callq	puts@PLT
.LBB1_12:                               #   in Loop: Header=BB1_4 Depth=1
	movq	(%r14), %rax
	movq	%r14, %r13
	movslq	12(%rsp), %r14
	movslq	(%rax,%r14,4), %rdi
	movq	224(%rsp), %rax
	addq	%rdi, (%rax)
	shlq	$2, %rdi
	callq	malloc
	movq	(%r12), %rcx
	movq	%rax, (%rcx,%r14,8)
	movq	(%r13), %rax
	movslq	(%rax,%r14,4), %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	(%r15), %rcx
	movq	%rax, (%rcx,%r14,8)
	movq	(%r13), %rax
	movslq	(%rax,%r14,4), %rdi
	addq	%rdi, %rdi
	callq	malloc
	movq	24(%rsp), %rcx                  # 8-byte Reload
	movq	(%rcx), %rcx
	movq	%rax, (%rcx,%r14,8)
	movq	%rbx, %rdi
	movl	$100, %esi
	movq	%rbp, %rdx
	callq	fgets
	movq	%rbp, %rdi
	callq	feof
	testl	%eax, %eax
	jne	.LBB1_17
# %bb.13:                               #   in Loop: Header=BB1_4 Depth=1
	cmpb	$45, 48(%rsp)
	je	.LBB1_17
# %bb.14:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB1_4 Depth=1
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
.LBB1_15:                               # %.lr.ph
                                        #   Parent Loop BB1_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	(%r12), %rax
	movslq	12(%rsp), %rsi
	movq	(%rax,%rsi,8), %rdx
	addq	%r14, %rdx
	movq	24(%rsp), %rax                  # 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax,%rsi,8), %rcx
	addq	%r13, %rcx
	movq	(%r15), %rax
	movq	(%rax,%rsi,8), %r8
	addq	%r14, %r8
	movl	$.L.str.6, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	movq	%rbx, %rdi
	movl	$100, %esi
	movq	%rbp, %rdx
	callq	fgets
	movq	%rbp, %rdi
	callq	feof
	testl	%eax, %eax
	jne	.LBB1_17
# %bb.16:                               # %.lr.ph
                                        #   in Loop: Header=BB1_15 Depth=2
	addq	$4, %r14
	addq	$2, %r13
	cmpb	$45, 48(%rsp)
	jne	.LBB1_15
.LBB1_17:                               # %.critedge
                                        #   in Loop: Header=BB1_4 Depth=1
	movq	%rbp, %rdi
	callq	feof
	testl	%eax, %eax
	movq	40(%rsp), %r14                  # 8-byte Reload
	movl	16(%rsp), %eax                  # 4-byte Reload
	jne	.LBB1_19
# %bb.18:                               #   in Loop: Header=BB1_4 Depth=1
	incl	%eax
	cmpl	(%r14), %eax
	jl	.LBB1_4
.LBB1_19:                               # %.critedge2
	movq	%rbp, %rdi
	callq	fflush
	movq	%rbp, %rdi
	callq	fclose
	addq	$152, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_20:
	.cfi_def_cfa_offset 208
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movl	$1, %edi
	callq	exit
.Lfunc_end1:
	.size	_Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py, .Lfunc_end1-_Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z14readQueryBatchPPPiS_S0_
.LCPI2_0:
	.byte	46                              # 0x2e
	.byte	46                              # 0x2e
	.byte	47                              # 0x2f
	.byte	113                             # 0x71
	.byte	117                             # 0x75
	.byte	101                             # 0x65
	.byte	114                             # 0x72
	.byte	121                             # 0x79
	.byte	95                              # 0x5f
	.byte	108                             # 0x6c
	.byte	111                             # 0x6f
	.byte	103                             # 0x67
	.byte	47                              # 0x2f
	.byte	116                             # 0x74
	.byte	114                             # 0x72
	.byte	97                              # 0x61
.LCPI2_1:
	.byte	110                             # 0x6e
	.byte	115                             # 0x73
	.byte	99                              # 0x63
	.byte	114                             # 0x72
	.byte	105                             # 0x69
	.byte	112                             # 0x70
	.byte	116                             # 0x74
	.byte	95                              # 0x5f
	.byte	113                             # 0x71
	.byte	117                             # 0x75
	.byte	101                             # 0x65
	.byte	114                             # 0x72
	.byte	121                             # 0x79
	.byte	95                              # 0x5f
	.byte	48                              # 0x30
	.byte	0                               # 0x0
	.text
	.globl	_Z14readQueryBatchPPPiS_S0_
	.type	_Z14readQueryBatchPPPiS_S0_,@function
_Z14readQueryBatchPPPiS_S0_:            # @_Z14readQueryBatchPPPiS_S0_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, 16(%rsp)                  # 8-byte Spill
	movq	%rsi, 8(%rsp)                   # 8-byte Spill
	movq	%rdi, %r15
	movaps	.LCPI2_0(%rip), %xmm0           # xmm0 = [46,46,47,113,117,101,114,121,95,108,111,103,47,116,114,97]
	leaq	48(%rsp), %r14
	movaps	%xmm0, (%r14)
	movaps	.LCPI2_1(%rip), %xmm0           # xmm0 = [110,115,99,114,105,112,116,95,113,117,101,114,121,95,48,0]
	movaps	%xmm0, 16(%r14)
	movl	$100, %edi
	callq	malloc
	movq	%rax, %r12
	movl	$.L.str.1, %esi
	movq	%r14, %rdi
	callq	fopen
	testq	%rax, %rax
	je	.LBB2_15
# %bb.1:
	movq	%rax, %r13
	movq	%r12, %rdi
	movl	$100, %esi
	movq	%rax, %rdx
	callq	fgets
	testq	%rax, %rax
	jne	.LBB2_3
# %bb.2:
	movl	$.Lstr.9, %edi
	callq	puts@PLT
.LBB2_3:
	movq	8(%rsp), %rax                   # 8-byte Reload
	movslq	(%rax), %r14
	shlq	$3, %r14
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, (%r15)
	movq	%r14, %rdi
	callq	malloc
	movq	16(%rsp), %rcx                  # 8-byte Reload
	movq	%rax, (%rcx)
	leaq	40(%rsp), %rbp
	leaq	4(%rsp), %r14
	xorl	%ebx, %ebx
	movq	%r12, 32(%rsp)                  # 8-byte Spill
	movq	%r13, 24(%rsp)                  # 8-byte Spill
.LBB2_4:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_5 Depth 2
                                        #     Child Loop BB2_8 Depth 2
	movq	%r12, %rax
	movl	$1, %r13d
.LBB2_5:                                #   Parent Loop BB2_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%rax), %ecx
	cmpl	$32, %ecx
	je	.LBB2_13
# %bb.6:                                #   in Loop: Header=BB2_5 Depth=2
	testl	%ecx, %ecx
	jne	.LBB2_14
	jmp	.LBB2_7
.LBB2_13:                               #   in Loop: Header=BB2_5 Depth=2
	incl	%r13d
.LBB2_14:                               #   in Loop: Header=BB2_5 Depth=2
	incq	%rax
	jmp	.LBB2_5
.LBB2_7:                                #   in Loop: Header=BB2_4 Depth=1
	movq	16(%rsp), %rax                  # 8-byte Reload
	movq	(%rax), %rax
	movl	%r13d, (%rax,%rbx,4)
	movslq	%r13d, %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	cmpl	$2, %r13d
	movl	$1, %eax
	cmovll	%eax, %r13d
	movq	%r12, %rdi
	xorl	%r12d, %r12d
.LBB2_8:                                #   Parent Loop BB2_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$.L.str.10, %esi
	movq	%rbp, %rdx
	callq	strtok_r
	movl	$.L.str.3, %esi
	movq	%rax, %rdi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	movl	4(%rsp), %eax
	movq	(%r15), %rcx
	movq	(%rcx,%rbx,8), %rcx
	movl	%eax, (%rcx,%r12,4)
	incq	%r12
	movl	$0, %edi
	cmpq	%r12, %r13
	jne	.LBB2_8
# %bb.9:                                #   in Loop: Header=BB2_4 Depth=1
	movq	32(%rsp), %r12                  # 8-byte Reload
	movq	%r12, %rdi
	movl	$100, %esi
	movq	24(%rsp), %r13                  # 8-byte Reload
	movq	%r13, %rdx
	callq	fgets
	movq	%r13, %rdi
	callq	feof
	testq	%r12, %r12
	je	.LBB2_12
# %bb.10:                               #   in Loop: Header=BB2_4 Depth=1
	testl	%eax, %eax
	jne	.LBB2_12
# %bb.11:                               #   in Loop: Header=BB2_4 Depth=1
	incq	%rbx
	movq	8(%rsp), %rax                   # 8-byte Reload
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	.LBB2_4
.LBB2_12:                               # %.critedge
	movq	%r12, %rdi
	callq	free
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB2_15:
	.cfi_def_cfa_offset 144
	movl	$.Lstr.8, %edi
	callq	puts@PLT
	movl	$1, %edi
	callq	exit
.Lfunc_end2:
	.size	_Z14readQueryBatchPPPiS_S0_, .Lfunc_end2-_Z14readQueryBatchPPPiS_S0_
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"../input/postingsquery_"
	.size	.L.str, 24

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"r"
	.size	.L.str.1, 2

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"%d"
	.size	.L.str.3, 3

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%f"
	.size	.L.str.5, 3

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"%d %hu %d"
	.size	.L.str.6, 10

	.type	.L__const._Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py.fileName,@object # @__const._Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py.fileName
	.section	.rodata,"a",@progbits
	.p2align	4, 0x0
.L__const._Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py.fileName:
	.asciz	"../input/postingsquery_\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
	.size	.L__const._Z16readInvertedListPiPfPPS_S2_PPPtPS0_S6_S1_Py.fileName, 100

	.type	.L.str.10,@object               # @.str.10
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.10:
	.asciz	" "
	.size	.L.str.10, 2

	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"Where is the file?"
	.size	.Lstr, 19

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"Where is the file of inverted list?"
	.size	.Lstr.2, 36

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Erro in FileManager!!!"
	.size	.Lstr.3, 23

	.type	.Lstr.8,@object                 # @str.8
.Lstr.8:
	.asciz	"Where is the file of query batch?"
	.size	.Lstr.8, 34

	.type	.Lstr.9,@object                 # @str.9
.Lstr.9:
	.asciz	"Error in FileManager!!!"
	.size	.Lstr.9, 24

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
