// File: /workspace/github_c_makefile_star2_O3/veltzer[P]xmeltdown/src/stickread.c
// Function: ReadFile
Skeleton**ReadFile(char* filename)
{
	FILE* infile;
	Skeleton** retval;
	int numread=1, okayflag=1, tempradius;
	Skeleton* current;

	infile=fopen(filename, "r");
	if (infile == NULL) {
		fprintf(stderr, "Cannot open file %s\n", filename);
		exit(1);
	}
	retval=(Skeleton **) calloc (2, sizeof (Skeleton *));
	retval[0]=(Skeleton *) calloc (1, sizeof (Skeleton));
	retval[1]=NULL;
	current=retval[0];
	okayflag=fscanf(infile, "%d, %d, %d\n", &tempradius, &waistx, &waisty);
	while (okayflag >= 0) {
		current->headradius=tempradius;
		current->waistx=waistx;
		current->waisty=waisty;

		Fill (infile, &(current->torso));
		Fill (infile, &(current->rthigh));
		Fill (infile, &(current->rshin));
		Fill (infile, &(current->rfoot));
		Fill (infile, &(current->rbicep));
		Fill (infile, &(current->rtricep));
		Fill (infile, &(current->lthigh));
		Fill (infile, &(current->lshin));
		Fill (infile, &(current->lfoot));
		Fill (infile, &(current->lbicep));
		Fill (infile, &(current->ltricep));

		printf ("Read %d skeleton%s\n",
			numread, numread == 1 ? "." : "s.");
		okayflag=fscanf(infile, "%d, %d, %d\n", &tempradius, &waistx, &waisty);
		if (okayflag >= 0) {
			numread++;
			retval=(Skeleton **)
				realloc (
				retval, (numread+1)*sizeof (Skeleton *));

			retval[numread-1]=(Skeleton *)calloc (1, sizeof (Skeleton));

			retval[numread]=0;
			current=retval[numread-1];
		}else
			printf ("Nothing else to read\n");
	}
	return (retval);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0x1bc0(%rip), %rsi      # 0x3047
callq 0x1090
testq %rax, %rax
je 0x17cf
movq %rax, %rbx
movl $0x2, %edi
movl $0x8, %esi
callq 0x1150
movq %rax, %r14
movl $0x1, %edi
movl $0x170, %esi            # imm = 0x170
callq 0x1150
movq %rax, %rbp
movq %rax, (%r14)
leaq 0x1c03(%rip), %rsi      # 0x30c9
leaq 0x3c4b(%rip), %rcx      # 0x5118
leaq 0x3c48(%rip), %r8       # 0x511c
leaq 0x14(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1050
testl %eax, %eax
js 0x17bd
movq %r14, 0x18(%rsp)
movl $0x1, %r15d
movl $0x18, %eax
movq %rax, 0x20(%rsp)
leaq 0xc(%rsp), %r14
movl 0x14(%rsp), %eax
movl %eax, (%rbp)
movl 0x3c06(%rip), %eax      # 0x5118
movl %eax, 0x4(%rbp)
movl 0x3c01(%rip), %eax      # 0x511c
movl %eax, 0x8(%rbp)
movq %rbx, %rdi
leaq 0x1bae(%rip), %r13      # 0x30d6
movq %r13, %rsi
leaq 0x10(%rsp), %r12
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x10(%rsp), %eax
movl %eax, 0x10(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movsd %xmm0, 0x18(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x10(%rsp), %eax
movl %eax, 0x30(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movsd %xmm0, 0x38(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x10(%rsp), %eax
movl %eax, 0x50(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movsd %xmm0, 0x58(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x10(%rsp), %eax
movl %eax, 0x70(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movsd %xmm0, 0x78(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x10(%rsp), %eax
movl %eax, 0x90(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movsd %xmm0, 0x98(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x10(%rsp), %eax
movl %eax, 0xb0(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movsd %xmm0, 0xb8(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x10(%rsp), %eax
movl %eax, 0xd0(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movsd %xmm0, 0xd8(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x10(%rsp), %eax
movl %eax, 0xf0(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movsd %xmm0, 0xf8(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x10(%rsp), %eax
movl %eax, 0x110(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movsd %xmm0, 0x118(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x10(%rsp), %eax
movl %eax, 0x130(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movsd %xmm0, 0x138(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x10(%rsp), %eax
movl %eax, 0x150(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movsd %xmm0, 0x158(%rbp)
cmpl $0x1, %r15d
leaq 0x195b(%rip), %rdx      # 0x3072
leaq 0x1927(%rip), %rax      # 0x3045
cmoveq %rax, %rdx
leaq 0x1935(%rip), %rdi      # 0x305e
movl %r15d, %esi
xorl %eax, %eax
callq 0x1030
movq %rbx, %rdi
leaq 0x198c(%rip), %rsi      # 0x30c9
leaq 0x14(%rsp), %rdx
leaq 0x39cf(%rip), %rcx      # 0x5118
leaq 0x39cc(%rip), %r8       # 0x511c
xorl %eax, %eax
callq 0x1050
testl %eax, %eax
js 0x17ac
incl %r15d
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %r12
movq %r12, %rsi
callq 0x1180
movl %r15d, %r13d
movq %rax, %r15
movl $0x1, %edi
movl $0x170, %esi            # imm = 0x170
callq 0x1150
movq %rax, %rbp
movq %rax, -0x10(%r15,%r12)
movq %r15, 0x18(%rsp)
movq $0x0, -0x8(%r15,%r12)
movl %r13d, %r15d
addq $0x8, %r12
movq %r12, 0x20(%rsp)
jmp 0x1505
leaq 0x18c2(%rip), %rdi      # 0x3075
callq 0x1060
movq 0x18(%rsp), %r14
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x11d0