// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq 0x2a245(%rip), %rdi     # 0x3e180
callq 0x1fa40
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x2a22b(%rip)     # 0x3e178
jne 0x13f86
movq 0x2a0a2(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
leaq 0x2171a(%rip), %rsi     # 0x3567a
movb $0x0, %al
callq 0x1140
movq 0x2a212(%rip), %rdi     # 0x3e180
movq 0x40(%rsp), %rsi
callq 0x1fb30
movq $0x0, 0x50(%rsp)
jmp 0x14411
movq 0x2a1fb(%rip), %rdi     # 0x3e188
movq 0x2a1fc(%rip), %rsi     # 0x3e190
movq 0x2a1dd(%rip), %rdx     # 0x3e178
callq 0x11e0
cmpq $-0x1, %rax
jne 0x13fdd
movq 0x2a04b(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
leaq 0x216e3(%rip), %rsi     # 0x3569a
movb $0x0, %al
callq 0x1140
movq 0x2a1bb(%rip), %rdi     # 0x3e180
movq 0x40(%rsp), %rsi
callq 0x1fb30
movq $0x0, 0x50(%rsp)
jmp 0x14411
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
movq 0x40(%rsp), %rsi
addq $0xc, %rsi
movq 0x40(%rsp), %rdx
movq 0x40(%rsp), %rcx
addq $0x4, %rcx
callq 0x14420
cmpl $0x4, %eax
je 0x1407e
movq 0x2a17a(%rip), %rax     # 0x3e188
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x24, %eax
je 0x1405f
movq 0x29fd8(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
movq 0x2a15e(%rip), %rax     # 0x3e188
movq (%rax), %rdx
movq 0x40(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x40(%rsp), %rax
movl 0xc(%rax), %r8d
movq 0x40(%rsp), %rax
movl (%rax), %r9d
movq 0x40(%rsp), %rax
movl 0x4(%rax), %eax
leaq 0x21675(%rip), %rsi     # 0x356ca
movl %eax, (%rsp)
movb $0x0, %al
callq 0x1140
movq 0x2a11a(%rip), %rdi     # 0x3e180
movq 0x40(%rsp), %rsi
callq 0x1fb30
movq $0x0, 0x50(%rsp)
jmp 0x14411
movq 0x40(%rsp), %rax
movslq (%rax), %rdi
shlq $0x3, %rdi
callq 0x1170
movq 0x40(%rsp), %rcx
movq %rax, 0x10(%rcx)
cmpq $0x0, %rax
jne 0x140d5
movq 0x29f53(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
leaq 0x21651(%rip), %rsi     # 0x35700
movb $0x0, %al
callq 0x1140
movq 0x2a0c3(%rip), %rdi     # 0x3e180
movq 0x40(%rsp), %rsi
callq 0x1fb30
movq $0x0, 0x50(%rsp)
jmp 0x14411
movq 0x2a0bc(%rip), %rdi     # 0x3e198
movq 0x2a0bd(%rip), %rsi     # 0x3e1a0
movq 0x2a08e(%rip), %rdx     # 0x3e178
callq 0x11e0
cmpq $-0x1, %rax
jne 0x1412c
movq 0x29efc(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
leaq 0x21615(%rip), %rsi     # 0x3571b
movb $0x0, %al
callq 0x1140
movq 0x2a06c(%rip), %rdi     # 0x3e180
movq 0x40(%rsp), %rsi
callq 0x1fb30
movq $0x0, 0x50(%rsp)
jmp 0x14411
movq 0x2a065(%rip), %rax     # 0x3e198
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movl $0x0, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x14224
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x14510
cmpl $-0x1, %eax
je 0x141db
movq 0x2a011(%rip), %rax     # 0x3e180
movq 0x10(%rax), %rdi
callq 0x1f6a0
movq %rax, %rdx
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x4c(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x30(%rsp), %rcx
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x4c(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, (%rax)
movl 0x4c(%rsp), %ecx
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x4c(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x18(%rax)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x4c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl $0x1, 0x24(%rax)
jmp 0x14212
movq 0x29e16(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
leaq 0x2155e(%rip), %rsi     # 0x3574a
movb $0x0, %al
callq 0x1140
movq 0x29f86(%rip), %rdi     # 0x3e180
movq 0x40(%rsp), %rsi
callq 0x1fb30
movq $0x0, 0x50(%rsp)
jmp 0x14411
jmp 0x14214
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x14143
movq 0x29f7d(%rip), %rdi     # 0x3e1a8
movq 0x29f7e(%rip), %rsi     # 0x3e1b0
movq 0x29f3f(%rip), %rdx     # 0x3e178
callq 0x11e0
cmpq $-0x1, %rax
jne 0x1427b
movq 0x29dad(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
leaq 0x21513(%rip), %rsi     # 0x35768
movb $0x0, %al
callq 0x1140
movq 0x29f1d(%rip), %rdi     # 0x3e180
movq 0x40(%rsp), %rsi
callq 0x1fb30
movq $0x0, 0x50(%rsp)
jmp 0x14411
movq 0x29f26(%rip), %rax     # 0x3e1a8
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movl $0x0, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x14407
leaq 0x38(%rsp), %rdi
leaq 0x24(%rsp), %rsi
leaq 0x20(%rsp), %rdx
leaq 0x28(%rsp), %rcx
callq 0x145d0
cmpl $0x3, %eax
jne 0x143c1
movq 0x29eb3(%rip), %rax     # 0x3e180
movq 0x18(%rax), %rdi
callq 0x1f310
movq %rax, 0x18(%rsp)
movq 0x29e9e(%rip), %rax     # 0x3e180
movq 0x18(%rax), %rdi
callq 0x1f310
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x24(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x20(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x28(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
movl $0x1, 0x28(%rax)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0xa660
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x20(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x24(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rsp), %rsi
callq 0xa660
jmp 0x143f5
movq 0x29c30(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
leaq 0x213c3(%rip), %rsi     # 0x35795
movb $0x0, %al
callq 0x1140
movq 0x29da0(%rip), %rdi     # 0x3e180
movq 0x40(%rsp), %rsi
callq 0x1fb30
movq $0x0, 0x50(%rsp)
jmp 0x14411
jmp 0x143f7
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x14292
movq 0x40(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopl (%rax,%rax)