// File: /workspace/github_c_makefile_star2_O3/pwelke[P]GraphMiningTools/loading.c
// Function: iterateFile
struct Graph* iterateFile() {
	int i;
	struct Graph* g = getGraph(FI_GP);
	const char* currentPosition;

	if (!FI_DATABASE) {
		fprintf(stderr, "Could not access input stream.\n");
		dumpGraph(FI_GP, g);
		return NULL;
	}

	/* copy header line to local variable
	dependent on GNU C */
	if (getline(HEAD_PTR, HEAD_SIZE, FI_DATABASE) == -1) {
		fprintf(stderr, "Could not read graph header from input stream.\n");
		dumpGraph(FI_GP, g);
		return NULL;
	}
			
	/* parse header */	
	if (parseHeader(&(g->number), &(g->activity), &(g->n), &(g->m)) != 4) {
		/* if reading of header does not work anymore, check if we have reached the correct end of the stream */
		if (**HEAD_PTR != '$') {
			fprintf(stderr, "Invalid Graph header: %s\nparsing result: %i %i %i %i\n", *HEAD_PTR, g->number, g->activity, g->n, g->m);
		}
		dumpGraph(FI_GP, g);
		return NULL;
	}

	/* read vertices */
	if ((g->vertices = malloc(g->n * sizeof(struct Vertex*))) == NULL) {
		fprintf(stderr, "Error allocating vertices\n");
		dumpGraph(FI_GP, g);
		return NULL;
	}

	/* copy vertex line to local variable
	dependent on GNU C */
	if (getline(VERTEX_PTR, VERTEX_SIZE, FI_DATABASE) == -1) {
		fprintf(stderr, "Could not read vertex line from input stream.\n");
		dumpGraph(FI_GP, g);
		return NULL;
	}

	/* parse vertex info */
	currentPosition = *VERTEX_PTR;
	for (i=0; i<g->n; ++i) {
		char* label;
		if (grabLabel(&currentPosition, &label) != -1) {
			g->vertices[i] = getVertex(FI_GP->vertexPool);
			g->vertices[i]->label = label;
			g->vertices[i]->number = i;
			g->vertices[i]->isStringMaster = 1;
		} else {
			fprintf(stderr, "Error while parsing vertices\n");
			dumpGraph(FI_GP, g);
			return NULL;
		}
	}
					
	/* copy edge line to local variable
	dependent on GNU C */
	if (getline(EDGE_PTR, EDGE_SIZE, FI_DATABASE) == -1) {
		fprintf(stderr, "Could not read edge line from input stream.\n");
		dumpGraph(FI_GP, g);
		return NULL;
	}

	/* parse edge info */
	currentPosition = *EDGE_PTR;
	for (i=0; i<g->m; ++i) {
		char* label;
		int v,w;

		if (parseEdgeNew(&currentPosition, &v, &w, &label) == 3) {
			
			struct VertexList* e = getVertexList(FI_GP->listPool);
			struct VertexList* f = getVertexList(FI_GP->listPool);

			/* edge */
			e->startPoint = g->vertices[v-1];
			e->endPoint = g->vertices[w-1];
			e->label = label;
			e->isStringMaster = 1;

			addEdge(e->startPoint, e);

			/* reverse edge*/
			f->startPoint = g->vertices[w-1];
			f->endPoint = g->vertices[v-1];
			f->label = e->label;

			addEdge(f->startPoint, f);
		} else {
			fprintf(stderr, "Error while parsing edges\n");
			dumpGraph(FI_GP, g);
			return NULL;
		}
	}
	return g;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x1feb5(%rip), %rdi     # 0x2d188
callq 0x146a9
movq %rax, %rbx
movq 0x1fe9e(%rip), %rdx     # 0x2d180
testq %rdx, %rdx
je 0xd59a
movq %rax, %r14
movq 0x1fe9b(%rip), %rdi     # 0x2d190
movq 0x1fe9c(%rip), %rsi     # 0x2d198
callq 0x1200
cmpq $-0x1, %rax
je 0xd5a4
leaq 0x8(%r14), %rdi
leaq 0xc(%r14), %rsi
addq $0x4, %r14
movq %rbx, %rdx
movq %r14, %rcx
callq 0xd628
cmpl $0x4, %eax
jne 0xd568
movslq (%rbx), %rdi
shlq $0x3, %rdi
callq 0x1190
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0xd5ae
movq 0x1fe55(%rip), %rdi     # 0x2d1a0
movq 0x1fe56(%rip), %rsi     # 0x2d1a8
movq 0x1fe27(%rip), %rdx     # 0x2d180
callq 0x1200
cmpq $-0x1, %rax
je 0xd5e2
movq %r14, 0x28(%rsp)
movq 0x1fe2c(%rip), %rax     # 0x2d1a0
movq (%rax), %r15
movq %r15, 0x18(%rsp)
cmpl $0x0, (%rbx)
jle 0xd470
xorl %r14d, %r14d
callq 0x1260
movq %rax, %rbp
movq %rax, 0x10(%rsp)
movq (%rbp), %rax
movsbq (%r15), %rcx
movzwl (%rax,%rcx,2), %ecx
xorl %r12d, %r12d
btl $0xd, %ecx
jb 0xd3af
movq %r15, %rdx
jmp 0xd3c6
movsbq 0x1(%r15,%r12), %rcx
incq %r12
movzwl (%rax,%rcx,2), %ecx
btl $0xd, %ecx
jb 0xd3af
leaq (%r15,%r12), %rdx
btl $0xd, %ecx
jb 0xd422
xorl %ebp, %ebp
movsbq 0x1(%rdx,%rbp), %rcx
incq %rbp
testb $0x20, 0x1(%rax,%rcx,2)
je 0xd3ce
testq %rbp, %rbp
je 0xd427
leaq 0x1(%rbp), %rdi
callq 0x1190
testq %rax, %rax
je 0xd427
movq %rax, %r13
addq %r12, %r15
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x1170
movb $0x0, (%r13,%rbp)
addq %rbp, %r15
movq %r15, 0x18(%rsp)
cmpl $-0x1, %ebp
movq 0x10(%rsp), %rbp
jne 0xd42f
jmp 0xd61b
xorl %r13d, %r13d
jmp 0xd42f
xorl %r13d, %r13d
movq 0x10(%rsp), %rbp
movq 0x1fd52(%rip), %rax     # 0x2d188
movq 0x10(%rax), %rdi
callq 0x1447e
movq 0x10(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
movq 0x10(%rbx), %rax
movq (%rax,%r14,8), %rcx
movq %r13, (%rcx)
movq (%rax,%r14,8), %rax
movl %r14d, 0x18(%rax)
movl $0x1, 0x24(%rax)
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0xd395
movq 0x1fd39(%rip), %rdi     # 0x2d1b0
movq 0x1fd3a(%rip), %rsi     # 0x2d1b8
movq 0x1fcfb(%rip), %rdx     # 0x2d180
callq 0x1200
cmpq $-0x1, %rax
je 0xd5ec
movq 0x1fd15(%rip), %rax     # 0x2d1b0
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x0, (%rax)
jle 0xd588
xorl %r15d, %r15d
leaq 0x18(%rsp), %rdi
leaq 0x24(%rsp), %rsi
leaq 0x20(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0xd82b
cmpl $0x3, %eax
jne 0xd5f6
movq 0x1fcab(%rip), %rax     # 0x2d188
movq 0x18(%rax), %rdi
callq 0x141f1
movq %rax, %rbp
movq 0x1fc98(%rip), %rax     # 0x2d188
movq 0x18(%rax), %rdi
callq 0x141f1
movq %rax, %r14
movq 0x10(%rbx), %rax
movslq 0x24(%rsp), %r12
movq -0x8(%rax,%r12,8), %rdi
movq %rdi, 0x10(%rbp)
movslq 0x20(%rsp), %r13
movq -0x8(%rax,%r13,8), %rax
movq %rax, 0x18(%rbp)
movq 0x30(%rsp), %rax
movq %rax, (%rbp)
movl $0x1, 0x28(%rbp)
movq %rbp, %rsi
callq 0x7cfe
movq 0x10(%rbx), %rax
movq -0x8(%rax,%r13,8), %rdi
movq %rdi, 0x10(%r14)
movq -0x8(%rax,%r12,8), %rax
movq %rax, 0x18(%r14)
movq (%rbp), %rax
movq %rax, (%r14)
movq %r14, %rsi
callq 0x7cfe
incl %r15d
cmpl 0x4(%rbx), %r15d
jl 0xd4b4
jmp 0xd588
movq 0x1fc21(%rip), %rax     # 0x2d190
movq (%rax), %rdx
cmpb $0x24, (%rdx)
jne 0xd5b8
movq 0x1fc0a(%rip), %rdi     # 0x2d188
movq %rbx, %rsi
callq 0x14700
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x13c4
jmp 0xd586
movq %rbx, %rdi
callq 0x1394
jmp 0xd586
movq %rbx, %rdi
callq 0x1364
jmp 0xd586
movq 0x1fa39(%rip), %rax     # 0x2cff8
movq (%rax), %rdi
movl 0x8(%rbx), %ecx
movl 0xc(%rbx), %r8d
movl (%rbx), %r9d
movl 0x4(%rbx), %eax
movl %eax, (%rsp)
leaq 0x1307e(%rip), %rsi     # 0x20657
xorl %eax, %eax
callq 0x1160
jmp 0xd577
movq %rbx, %rdi
callq 0x1334
jmp 0xd586
movq %rbx, %rdi
callq 0x1304
jmp 0xd586
movq 0x1f9fb(%rip), %rax     # 0x2cff8
movq (%rax), %rcx
leaq 0x1311b(%rip), %rdi     # 0x20722
movl $0x1a, %esi
movl $0x1, %edx
callq 0x1220
jmp 0xd577
movq %rbx, %rdi
callq 0x12d4
jmp 0xd586