// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
movq 0x1f4fd(%rip), %rdi     # 0x2a180
callq 0x11619
movq %rax, %rbx
movq 0x1f4e6(%rip), %rdx     # 0x2a178
testq %rdx, %rdx
je 0xaecb
movq %rax, %r14
movq 0x1f4e3(%rip), %rdi     # 0x2a188
movq 0x1f4e4(%rip), %rsi     # 0x2a190
callq 0x11f0
cmpq $-0x1, %rax
je 0xaee0
movq %r14, %rcx
leaq 0x8(%r14), %rdi
leaq 0xc(%r14), %rsi
addq $0x4, %rcx
movq %rbx, %rdx
movq %rcx, 0x20(%rsp)
callq 0xaf86
cmpl $0x4, %eax
jne 0xad93
movslq (%rbx), %rdi
shlq $0x3, %rdi
callq 0x1180
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0xaef5
movq 0x1f498(%rip), %rdi     # 0x2a198
movq 0x1f499(%rip), %rsi     # 0x2a1a0
movq 0x1f46a(%rip), %rdx     # 0x2a178
callq 0x11f0
cmpq $-0x1, %rax
je 0xaf08
movq 0x1f474(%rip), %rax     # 0x2a198
movq (%rax), %rax
leaq 0x18(%rsp), %r15
movq %rax, (%r15)
xorl %r13d, %r13d
leaq 0x8(%rsp), %r12
movslq (%rbx), %rax
cmpq %rax, %r13
jge 0xadd3
movq %r15, %rdi
movq %r12, %rsi
callq 0xb020
cmpl $-0x1, %eax
je 0xaf1d
movq 0x1f422(%rip), %rax     # 0x2a180
movq 0x10(%rax), %rdi
callq 0x114a5
movq 0x10(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x8(%rsp), %rax
movq 0x10(%rbx), %rcx
movq (%rcx,%r13,8), %rdx
movq %rax, (%rdx)
movq (%rcx,%r13,8), %rax
movl %r13d, 0x18(%rax)
movl $0x1, 0x24(%rax)
incq %r13
jmp 0xad37
movq 0x1f3ee(%rip), %rax     # 0x2a188
movq (%rax), %rdx
cmpb $0x24, (%rdx)
je 0xaf63
movq 0x1f24b(%rip), %rax     # 0x29ff8
movq (%rax), %rdi
movl 0x8(%rbx), %ecx
movl 0xc(%rbx), %r8d
movl (%rbx), %r9d
movl 0x4(%rbx), %eax
movl %eax, (%rsp)
leaq 0x12890(%rip), %rsi     # 0x1d657
xorl %eax, %eax
callq 0x1150
jmp 0xaf63
movq 0x1f3ce(%rip), %rdi     # 0x2a1a8
movq 0x1f3cf(%rip), %rsi     # 0x2a1b0
movq 0x1f390(%rip), %rdx     # 0x2a178
callq 0x11f0
cmpq $-0x1, %rax
je 0xaf32
movq 0x1f3aa(%rip), %rax     # 0x2a1a8
movq (%rax), %rax
leaq 0x18(%rsp), %rcx
movq %rax, (%rcx)
xorl %r13d, %r13d
movq 0x20(%rsp), %rax
cmpl (%rax), %r13d
jge 0xaf74
leaq 0x18(%rsp), %rdi
leaq 0x14(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0xb0d8
cmpl $0x3, %eax
jne 0xaf47
movq 0x1f33d(%rip), %rax     # 0x2a180
movq 0x18(%rax), %rdi
callq 0x11307
movq %rax, %r12
movq 0x1f32a(%rip), %rax     # 0x2a180
movq 0x18(%rax), %rdi
callq 0x11307
movq %rax, %r15
movq 0x10(%rbx), %rax
movslq 0x14(%rsp), %rbp
movq -0x8(%rax,%rbp,8), %rdi
movq %rdi, 0x10(%r12)
movslq 0x10(%rsp), %r14
movq -0x8(%rax,%r14,8), %rax
movq %rax, 0x18(%r12)
movq 0x8(%rsp), %rax
movq %rax, (%r12)
movl $0x1, 0x28(%r12)
movq %r12, %rsi
callq 0x5b2c
movq 0x10(%rbx), %rax
movq -0x8(%rax,%r14,8), %rdi
movq %rdi, 0x10(%r15)
movq -0x8(%rax,%rbp,8), %rax
movq %rax, 0x18(%r15)
movq (%r12), %rax
movq %rax, (%r15)
movq %r15, %rsi
callq 0x5b2c
incl %r13d
jmp 0xae0c
movq 0x1f126(%rip), %rax     # 0x29ff8
movq (%rax), %rcx
leaq 0x1272b(%rip), %rdi     # 0x1d607
pushq $0x1f
jmp 0xaf5a
movq 0x1f111(%rip), %rax     # 0x29ff8
movq (%rax), %rcx
leaq 0x12736(%rip), %rdi     # 0x1d627
pushq $0x2f
jmp 0xaf5a
movq 0x1f0fc(%rip), %rax     # 0x29ff8
movq (%rax), %rcx
leaq 0x12787(%rip), %rdi     # 0x1d68d
jmp 0xaf58
movq 0x1f0e9(%rip), %rax     # 0x29ff8
movq (%rax), %rcx
leaq 0x1278f(%rip), %rdi     # 0x1d6a8
pushq $0x2e
jmp 0xaf5a
movq 0x1f0d4(%rip), %rax     # 0x29ff8
movq (%rax), %rcx
leaq 0x127a9(%rip), %rdi     # 0x1d6d7
pushq $0x1d
jmp 0xaf5a
movq 0x1f0bf(%rip), %rax     # 0x29ff8
movq (%rax), %rcx
leaq 0x127b2(%rip), %rdi     # 0x1d6f5
pushq $0x2c
jmp 0xaf5a
movq 0x1f0aa(%rip), %rax     # 0x29ff8
movq (%rax), %rcx
leaq 0x127ca(%rip), %rdi     # 0x1d722
pushq $0x1a
popq %rsi
pushq $0x1
popq %rdx
callq 0x1210
movq 0x1f216(%rip), %rdi     # 0x2a180
movq %rbx, %rsi
callq 0x1166e
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq