// File: /workspace/github_c_makefile_star2_O1/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 $0x18, %rsp
movq %rdi, %r14
leaq 0x1bc0(%rip), %rsi      # 0x3047
callq 0x1090
testq %rax, %rax
je 0x17e3
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, %r15
movq %rax, (%r14)
movq %r14, 0x10(%rsp)
movq $0x0, 0x8(%r14)
leaq 0x1bde(%rip), %rsi      # 0x30b1
leaq 0x3c3e(%rip), %rcx      # 0x5118
leaq 0x3c3b(%rip), %r8       # 0x511c
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1050
testl %eax, %eax
js 0x17cf
movl $0x1, %r13d
movl 0xc(%rsp), %eax
movl %eax, (%r15)
movl 0x3c0d(%rip), %eax      # 0x5118
movl %eax, 0x4(%r15)
movl 0x3c07(%rip), %eax      # 0x511c
movl %eax, 0x8(%r15)
movq %rbx, %rdi
leaq 0x1b9b(%rip), %r14      # 0x30be
movq %r14, %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
leaq 0x4(%rsp), %rbp
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x8(%rsp), %eax
movl %eax, 0x10(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movsd %xmm0, 0x18(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x8(%rsp), %eax
movl %eax, 0x30(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movsd %xmm0, 0x38(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x8(%rsp), %eax
movl %eax, 0x50(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movsd %xmm0, 0x58(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x8(%rsp), %eax
movl %eax, 0x70(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movsd %xmm0, 0x78(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x8(%rsp), %eax
movl %eax, 0x90(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movsd %xmm0, 0x98(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x8(%rsp), %eax
movl %eax, 0xb0(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movsd %xmm0, 0xb8(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x8(%rsp), %eax
movl %eax, 0xd0(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movsd %xmm0, 0xd8(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x8(%rsp), %eax
movl %eax, 0xf0(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movsd %xmm0, 0xf8(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x8(%rsp), %eax
movl %eax, 0x110(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movsd %xmm0, 0x118(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x8(%rsp), %eax
movl %eax, 0x130(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movsd %xmm0, 0x138(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1050
movl 0x8(%rsp), %eax
movl %eax, 0x150(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movsd %xmm0, 0x158(%r15)
cmpl $0x1, %r13d
leaq 0x1945(%rip), %rdx      # 0x3072
leaq 0x1911(%rip), %rax      # 0x3045
cmoveq %rax, %rdx
leaq 0x191f(%rip), %rdi      # 0x305e
movl %r13d, %esi
xorl %eax, %eax
callq 0x1030
movq %rbx, %rdi
leaq 0x195e(%rip), %rsi      # 0x30b1
leaq 0xc(%rsp), %rdx
leaq 0x39b9(%rip), %rcx      # 0x5118
leaq 0x39b6(%rip), %r8       # 0x511c
xorl %eax, %eax
callq 0x1050
movl %eax, %ebp
testl %eax, %eax
js 0x17bb
movslq %r13d, %r12
incl %r13d
leaq 0x10(,%r12,8), %rsi
movq 0x10(%rsp), %rdi
callq 0x1180
movl %r13d, %r14d
movq %rax, %r13
movl $0x1, %edi
movl $0x170, %esi            # imm = 0x170
callq 0x1150
movq %rax, %r15
movq %rax, (%r13,%r12,8)
movq %r13, 0x10(%rsp)
movq $0x0, 0x8(%r13,%r12,8)
movl %r14d, %r13d
jmp 0x17c7
leaq 0x18b3(%rip), %rdi      # 0x3075
callq 0x1060
testl %ebp, %ebp
jns 0x14fe
movq 0x10(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x11d0