// File: /workspace/github_c_makefile_star2_O0/dapogon[P]cellcoal/src/cellcoal.c
// Function: ReadUserGenome
void ReadUserGenome (FILE *fp)
	{
	char	*header;
	

	/* allocate space for reading */
	header = (char*) calloc (MAX_LINE, sizeof(char));
	if (!header)
		{
		fprintf (stderr, "Could not allocate the header string\n");
		exit (-1);
		}

	maternalUserGenome = (char*) calloc (MAX_GENOME, sizeof(char));
	if (!maternalUserGenome)
		{
		fprintf (stderr, "Could not allocate the maternalUserGenome structure\n");
		exit (-1);
		}

	paternalUserGenome = (char*) calloc (MAX_GENOME, sizeof(char));
	if (!paternalUserGenome)
		{
		fprintf (stderr, "Could not allocate the paternalUserGenome structure\n");
		exit (-1);
		}
	
	/* open user genome */
	if ((fpUserGenome = fopen(userGenomeFile, "r")) == NULL)
		{
		fprintf (stderr, "\nERROR: Can't open user genome file \"%s\"\n", userGenomeFile);
		PrintUsage(stderr);
		}

	/* read the FASTA file */
	fgets (header, MAX_LINE, fpUserGenome);
	fgets (maternalUserGenome, MAX_GENOME, fpUserGenome);
	if (maternalUserGenome == NULL)
		{
		fprintf (stderr, "\nERROR: Can't read the user maternal genome");
		PrintUsage(stderr);
		}
	
	fgets (header, MAX_LINE, fpUserGenome);
	fgets (paternalUserGenome, MAX_GENOME, fpUserGenome);
	if (paternalUserGenome == NULL)
		{
		fprintf (stderr, "\nERROR: Can't read the user paternal genome");
		PrintUsage(stderr);
		}

	/* check lengths */
	if (strlen(maternalUserGenome) != strlen(paternalUserGenome))
		{
		fprintf (stderr, "\nERROR: maternal and paternal user genomes have different lengths");
		PrintUsage(stderr);
		}

	numSites = (int) strlen(maternalUserGenome) - 1;
	
	/* realloc memory */
	maternalUserGenome = (char *)realloc(maternalUserGenome, numSites * sizeof(char));
	paternalUserGenome = (char *)realloc(paternalUserGenome, numSites * sizeof(char));


	fprintf (stderr, "\nnumsites = %d", numSites);
	fprintf (stderr, "\nuser maternal genome = %s", maternalUserGenome);
	fprintf (stderr, "\nuser paternal genome = %s", paternalUserGenome);

	free (header);
	fclose(fpUserGenome);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x7a120, %edi          # imm = 0x7A120
movl $0x1, %esi
callq 0x2190
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xc148
movq 0x41ecb(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x34a80(%rip), %rsi     # 0x40bb7
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
movl $0xf4240, %edi          # imm = 0xF4240
movl $0x1, %esi
callq 0x2190
movq %rax, 0x437ba(%rip)     # 0x4f918
cmpq $0x0, 0x437b2(%rip)     # 0x4f918
jne 0xc18a
movq 0x41e89(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x34a64(%rip), %rsi     # 0x40bdd
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
movl $0xf4240, %edi          # imm = 0xF4240
movl $0x1, %esi
callq 0x2190
movq %rax, 0x43770(%rip)     # 0x4f910
cmpq $0x0, 0x43768(%rip)     # 0x4f910
jne 0xc1cc
movq 0x41e47(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x34a57(%rip), %rsi     # 0x40c12
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
leaq 0x431dd(%rip), %rdi     # 0x4f3b0
leaq 0x3334e(%rip), %rsi     # 0x3f528
callq 0x2230
movq %rax, 0x43552(%rip)     # 0x4f738
cmpq $0x0, %rax
jne 0xc21a
movq 0x41e05(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x34a4a(%rip), %rsi     # 0x40c47
leaq 0x431ac(%rip), %rdx     # 0x4f3b0
movb $0x0, %al
callq 0x21b0
movq 0x41de6(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
callq 0x9f20
movq -0x10(%rbp), %rdi
movq 0x43513(%rip), %rdx     # 0x4f738
movl $0x7a120, %esi          # imm = 0x7A120
callq 0x2180
movq 0x436e2(%rip), %rdi     # 0x4f918
movq 0x434fb(%rip), %rdx     # 0x4f738
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x2180
cmpq $0x0, 0x436c9(%rip)     # 0x4f918
jne 0xc278
movq 0x41da0(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x34a0f(%rip), %rsi     # 0x40c71
movb $0x0, %al
callq 0x21b0
movq 0x41d88(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
callq 0x9f20
movq -0x10(%rbp), %rdi
movq 0x434b5(%rip), %rdx     # 0x4f738
movl $0x7a120, %esi          # imm = 0x7A120
callq 0x2180
movq 0x4367c(%rip), %rdi     # 0x4f910
movq 0x4349d(%rip), %rdx     # 0x4f738
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x2180
cmpq $0x0, 0x43663(%rip)     # 0x4f910
jne 0xc2d6
movq 0x41d42(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x349dd(%rip), %rsi     # 0x40c9d
movb $0x0, %al
callq 0x21b0
movq 0x41d2a(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
callq 0x9f20
movq 0x4363b(%rip), %rdi     # 0x4f918
callq 0x2100
movq %rax, -0x18(%rbp)
movq 0x43623(%rip), %rdi     # 0x4f910
callq 0x2100
movq %rax, %rcx
movq -0x18(%rbp), %rax
cmpq %rcx, %rax
je 0xc325
movq 0x41cf3(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x349ba(%rip), %rsi     # 0x40cc9
movb $0x0, %al
callq 0x21b0
movq 0x41cdb(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
callq 0x9f20
movq 0x435ec(%rip), %rdi     # 0x4f918
callq 0x2100
subl $0x1, %eax
movl %eax, 0x41ea2(%rip)     # 0x4e1dc
movq 0x435d7(%rip), %rdi     # 0x4f918
movslq 0x41e94(%rip), %rsi     # 0x4e1dc
shlq $0x0, %rsi
callq 0x2220
movq %rax, 0x435c0(%rip)     # 0x4f918
movq 0x435b1(%rip), %rdi     # 0x4f910
movslq 0x41e76(%rip), %rsi     # 0x4e1dc
shlq $0x0, %rsi
callq 0x2220
movq %rax, 0x4359a(%rip)     # 0x4f910
movq 0x41c7b(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movl 0x41e56(%rip), %edx     # 0x4e1dc
leaq 0x3497e(%rip), %rsi     # 0x40d0b
movb $0x0, %al
callq 0x21b0
movq 0x41c5d(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movq 0x43573(%rip), %rdx     # 0x4f918
leaq 0x3496e(%rip), %rsi     # 0x40d1a
movb $0x0, %al
callq 0x21b0
movq 0x41c3e(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movq 0x4354c(%rip), %rdx     # 0x4f910
leaq 0x3496a(%rip), %rsi     # 0x40d35
movb $0x0, %al
callq 0x21b0
movq -0x10(%rbp), %rdi
callq 0x2030
movq 0x43356(%rip), %rdi     # 0x4f738
callq 0x20e0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)