// File: /workspace/github_c_makefile_star2_O0/dapogon[P]cellcoal/src/cellcoal.c
// Function: CheckTree
static void		CheckTree (char *treeStr)
	{
	int		i, k;
	int		thereIsError, numLeftPar, numRightPar;
	
	thereIsError = NO;
    numLeftPar = 1;
    numRightPar = 0;
	i = 1;

	do
		{
		if (treeStr[i] == '(')
			{
			if (treeStr[i-1] != '(' && treeStr[i-1] != ',')
				thereIsError = YES;
			if (treeStr[i+1] != '(' && isalnum(treeStr[i+1]) == NO)
				thereIsError = YES;
			numLeftPar++;
			}
		else if (treeStr[i] == ')')
			{
			if (treeStr[i-1] != ')' && isalnum(treeStr[i-1]) == NO)
				thereIsError = YES;
			if (treeStr[i+1] != ')' && treeStr[i+1] != ',' && treeStr[i+1] != ':')
				thereIsError = YES;
			if (treeStr[i+1] == ';' && i == strlen(treeStr)-3)
				thereIsError = NO;
			numRightPar++;
			}
		else if (treeStr[i] == ',')
			{
			if (treeStr[i-1] != ')' && isalnum(treeStr[i-1]) == NO)
				thereIsError = YES;
			if (treeStr[i+1] != '(' && isalnum(treeStr[i+1]) == NO)
				thereIsError = YES;
			}
		else if (treeStr[i] == ':')
			{
			if (treeStr[i-1] != ')' && isalnum(treeStr[i-1]) == NO)
				thereIsError = YES;
			if (isdigit(treeStr[i+1]) == NO)
				thereIsError = YES;
			}

		if (thereIsError == YES)
			{
			fprintf (stderr,"\nERROR: There is something wrong in the tree\n");
			for (k=0; k<=i; k++)
				fprintf (stderr,"%c", treeStr[k]);
			fprintf (stderr," <- HERE");
			PrintUsage(stderr);
			}
		
		i++;
	
		} while (treeStr[i] != ';');

	if (numLeftPar != numRightPar)
		{
		fprintf (stderr, "Tree seems unbalanced (%d left and %d right parentheses)", numLeftPar, numRightPar);
		PrintUsage(stderr);
		}
	if (strrchr(treeString, ':') == NULL)
		{
		fprintf (stderr, "Tree does not have branch lengths");
		PrintUsage(stderr);
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x1, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x1, -0xc(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x28, %eax
jne 0x198d3
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x28, %eax
je 0x19880
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
je 0x19880
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x28, %eax
je 0x198c5
callq 0x22c0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x198c5
movl $0x1, -0x14(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x19af5
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
jne 0x199c2
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
je 0x1992d
callq 0x22c0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x1992d
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
je 0x19976
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
je 0x19976
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
je 0x19976
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3b, %eax
jne 0x199b4
movslq -0xc(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2100
movq %rax, %rcx
movq -0x28(%rbp), %rax
subq $0x3, %rcx
cmpq %rcx, %rax
jne 0x199b4
movl $0x0, -0x14(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x19af3
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
jne 0x19a66
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
je 0x19a1c
callq 0x22c0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x19a1c
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x28, %eax
je 0x19a61
callq 0x22c0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x19a61
movl $0x1, -0x14(%rbp)
jmp 0x19af1
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x19aef
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
je 0x19abc
callq 0x22c0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x19abc
movl $0x1, -0x14(%rbp)
callq 0x22c0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x19aed
movl $0x1, -0x14(%rbp)
jmp 0x19aef
jmp 0x19af1
jmp 0x19af3
jmp 0x19af5
cmpl $0x1, -0x14(%rbp)
jne 0x19b78
movq 0x344f6(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x273f7(%rip), %rsi     # 0x40f03
movb $0x0, %al
callq 0x21b0
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0x19b51
movq 0x344cf(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movsbl (%rax,%rcx), %edx
leaq 0x2869a(%rip), %rsi     # 0x421d9
movb $0x0, %al
callq 0x21b0
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x19b1a
movq 0x344a0(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x273cf(%rip), %rsi     # 0x40f31
movb $0x0, %al
callq 0x21b0
movq 0x34488(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
callq 0x9f20
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3b, %eax
jne 0x19838
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0x19bcb
movq 0x34453(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
leaq 0x27385(%rip), %rsi     # 0x40f3a
movb $0x0, %al
callq 0x21b0
movq 0x34435(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
callq 0x9f20
movq 0x35d9e(%rip), %rdi     # 0x4f970
movl $0x3a, %esi
callq 0x2120
cmpq $0x0, %rax
jne 0x19c09
movq 0x3440f(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x27380(%rip), %rsi     # 0x40f73
movb $0x0, %al
callq 0x21b0
movq 0x343f7(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
callq 0x9f20
addq $0x30, %rsp
popq %rbp
retq
nop