// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x1, -0x1c(%rbp)
movl $0x1, -0x20(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x1b32(%rip), %rsi      # 0x3047
callq 0x1080
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x154b
movq 0x3abc(%rip), %rax      # 0x4fe8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x1b0f(%rip), %rsi      # 0x3049
movb $0x0, %al
callq 0x1180
movl $0x1, %edi
callq 0x1060
movl $0x2, %edi
movl $0x8, %esi
callq 0x1140
movq %rax, -0x18(%rbp)
movl $0x1, %edi
movl $0x170, %esi            # imm = 0x170
callq 0x1140
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1b08(%rip), %rsi      # 0x30a1
leaq -0x24(%rbp), %rdx
leaq 0x3b74(%rip), %rcx      # 0x5118
leaq 0x3b71(%rip), %r8       # 0x511c
movb $0x0, %al
callq 0x1050
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jl 0x1788
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl 0x3b4a(%rip), %ecx      # 0x5118
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movl 0x3b41(%rip), %ecx      # 0x511c
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x10, %rsi
callq 0x1c80
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x30, %rsi
callq 0x1c80
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x50, %rsi
callq 0x1c80
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x70, %rsi
callq 0x1c80
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x90, %rsi
callq 0x1c80
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0xb0, %rsi
callq 0x1c80
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0xd0, %rsi
callq 0x1c80
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0xf0, %rsi
callq 0x1c80
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x110, %rsi            # imm = 0x110
callq 0x1c80
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x130, %rsi            # imm = 0x130
callq 0x1c80
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
callq 0x1c80
movl -0x1c(%rbp), %esi
movl -0x1c(%rbp), %ecx
leaq 0x19b3(%rip), %rdx      # 0x3072
leaq 0x197f(%rip), %rax      # 0x3045
cmpl $0x1, %ecx
cmoveq %rax, %rdx
leaq 0x198a(%rip), %rdi      # 0x305e
movb $0x0, %al
callq 0x1030
movq -0x10(%rbp), %rdi
leaq 0x19bb(%rip), %rsi      # 0x30a1
leaq -0x24(%rbp), %rdx
leaq 0x3a27(%rip), %rcx      # 0x5118
leaq 0x3a24(%rip), %r8       # 0x511c
movb $0x0, %al
callq 0x1050
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jl 0x1775
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x1170
movq %rax, -0x18(%rbp)
movl $0x1, %edi
movl $0x170, %esi            # imm = 0x170
callq 0x1140
movq %rax, %rdx
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
jmp 0x1783
leaq 0x18f9(%rip), %rdi      # 0x3075
movb $0x0, %al
callq 0x1030
jmp 0x15b5
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)