// File: /workspace/github_c_makefile_star2_O0/phase[P]o/libregexp/regcomp.c
// Function: bldcclass
static int
bldcclass(void)
{
	int type;
	Rune r[NCCRUNE];
	Rune *p, *ep, *np;
	Rune rune;
	int quoted;

	/* we have already seen the '[' */
	type = CCLASS;
	yyclassp = newclass();

	/* look ahead for negation */
	/* SPECIAL CASE!!! negated classes don't match \n */
	ep = r;
	quoted = nextc(&rune);
	if(!quoted && rune == '^'){
		type = NCCLASS;
		quoted = nextc(&rune);
		*ep++ = '\n';
		*ep++ = '\n';
	}

	/* parse class into a set of spans */
	while(ep < &r[NCCRUNE-1]){
		if(rune == 0){
			rcerror("malformed '[]'");
			return 0;
		}
		if(!quoted && rune == ']')
			break;
		if(!quoted && rune == '-'){
			if(ep == r){
				rcerror("malformed '[]'");
				return 0;
			}
			quoted = nextc(&rune);
			if((!quoted && rune == ']') || rune == 0){
				rcerror("malformed '[]'");
				return 0;
			}
			*(ep-1) = rune;
		} else {
			*ep++ = rune;
			*ep++ = rune;
		}
		quoted = nextc(&rune);
	}
	if(ep >= &r[NCCRUNE-1]) {
		rcerror("char class too large; increase Reclass.spans size");
		return 0;
	}

	/* sort on span start */
	for(p = r; p < ep; p += 2){
		for(np = p; np < ep; np += 2)
			if(*np < *p){
				rune = np[0];
				np[0] = p[0];
				p[0] = rune;
				rune = np[1];
				np[1] = p[1];
				p[1] = rune;
			}
	}

	/* merge spans */
	np = yyclassp->spans;
	p = r;
	if(r == ep)
		yyclassp->end = np;
	else {
		np[0] = *p++;
		np[1] = *p++;
		for(; p < ep; p += 2)
			/* overlapping or adjacent ranges? */
			if(p[0] <= np[1] + 1){
				if(p[1] >= np[1])
					np[1] = p[1];	/* coalesce */
			} else {
				np += 2;
				np[0] = p[0];
				np[1] = p[1];
			}
		yyclassp->end = np+2;
	}

	return type;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movl $0xc5, -0x8(%rbp)
callq 0x9050
movq %rax, 0x77aa(%rip)      # 0x103b8
leaq -0x110(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x12c(%rbp), %rdi
callq 0x8b40
movl %eax, -0x130(%rbp)
cmpl $0x0, -0x130(%rbp)
jne 0x8c8f
cmpl $0x5e, -0x12c(%rbp)
jne 0x8c8f
movl $0xc6, -0x8(%rbp)
leaq -0x12c(%rbp), %rdi
callq 0x8b40
movl %eax, -0x130(%rbp)
movq -0x120(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x120(%rbp)
movl $0xa, (%rax)
movq -0x120(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x120(%rbp)
movl $0xa, (%rax)
jmp 0x8c91
movq -0x120(%rbp), %rax
leaq -0x110(%rbp), %rcx
addq $0xfc, %rcx
cmpq %rcx, %rax
jae 0x8dd4
cmpl $0x0, -0x12c(%rbp)
jne 0x8cd0
leaq 0x28e3(%rip), %rdi      # 0xb5a2
callq 0x88d0
movl $0x0, -0x4(%rbp)
jmp 0x9041
cmpl $0x0, -0x130(%rbp)
jne 0x8ce7
cmpl $0x5d, -0x12c(%rbp)
jne 0x8ce7
jmp 0x8dd4
cmpl $0x0, -0x130(%rbp)
jne 0x8d83
cmpl $0x2d, -0x12c(%rbp)
jne 0x8d83
movq -0x120(%rbp), %rax
leaq -0x110(%rbp), %rcx
cmpq %rcx, %rax
jne 0x8d2c
leaq 0x2887(%rip), %rdi      # 0xb5a2
callq 0x88d0
movl $0x0, -0x4(%rbp)
jmp 0x9041
leaq -0x12c(%rbp), %rdi
callq 0x8b40
movl %eax, -0x130(%rbp)
cmpl $0x0, -0x130(%rbp)
jne 0x8d50
cmpl $0x5d, -0x12c(%rbp)
je 0x8d59
cmpl $0x0, -0x12c(%rbp)
jne 0x8d71
leaq 0x2842(%rip), %rdi      # 0xb5a2
callq 0x88d0
movl $0x0, -0x4(%rbp)
jmp 0x9041
movl -0x12c(%rbp), %ecx
movq -0x120(%rbp), %rax
movl %ecx, -0x4(%rax)
jmp 0x8dbd
movl -0x12c(%rbp), %ecx
movq -0x120(%rbp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x120(%rbp)
movl %ecx, (%rax)
movl -0x12c(%rbp), %ecx
movq -0x120(%rbp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x120(%rbp)
movl %ecx, (%rax)
leaq -0x12c(%rbp), %rdi
callq 0x8b40
movl %eax, -0x130(%rbp)
jmp 0x8c91
movq -0x120(%rbp), %rax
leaq -0x110(%rbp), %rcx
addq $0xfc, %rcx
cmpq %rcx, %rax
jb 0x8e06
leaq 0x27bc(%rip), %rdi      # 0xb5b1
callq 0x88d0
movl $0x0, -0x4(%rbp)
jmp 0x9041
leaq -0x110(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rax
cmpq -0x120(%rbp), %rax
jae 0x8ef4
movq -0x118(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
cmpq -0x120(%rbp), %rax
jae 0x8edb
movq -0x128(%rbp), %rax
movl (%rax), %eax
movq -0x118(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x8ec2
movq -0x128(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x12c(%rbp)
movq -0x118(%rbp), %rax
movl (%rax), %ecx
movq -0x128(%rbp), %rax
movl %ecx, (%rax)
movl -0x12c(%rbp), %ecx
movq -0x118(%rbp), %rax
movl %ecx, (%rax)
movq -0x128(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x12c(%rbp)
movq -0x118(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x128(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x12c(%rbp), %ecx
movq -0x118(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x8ec4
movq -0x128(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x128(%rbp)
jmp 0x8e36
jmp 0x8edd
movq -0x118(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x118(%rbp)
jmp 0x8e14
movq 0x74bd(%rip), %rax      # 0x103b8
addq $0x8, %rax
movq %rax, -0x128(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x118(%rbp)
leaq -0x110(%rbp), %rax
cmpq -0x120(%rbp), %rax
jne 0x8f3a
movq -0x128(%rbp), %rcx
movq 0x7486(%rip), %rax      # 0x103b8
movq %rcx, (%rax)
jmp 0x903b
movq -0x118(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x118(%rbp)
movl (%rax), %ecx
movq -0x128(%rbp), %rax
movl %ecx, (%rax)
movq -0x118(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x118(%rbp)
movl (%rax), %ecx
movq -0x128(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x118(%rbp), %rax
cmpq -0x120(%rbp), %rax
jae 0x9026
movq -0x118(%rbp), %rax
movl (%rax), %eax
movq -0x128(%rbp), %rcx
movl 0x4(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
ja 0x8fd5
movq -0x118(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x128(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jb 0x8fd3
movq -0x118(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x128(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x900d
movq -0x128(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x128(%rbp)
movq -0x118(%rbp), %rax
movl (%rax), %ecx
movq -0x128(%rbp), %rax
movl %ecx, (%rax)
movq -0x118(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x128(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x900f
movq -0x118(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x118(%rbp)
jmp 0x8f7b
movq -0x128(%rbp), %rcx
addq $0x8, %rcx
movq 0x7380(%rip), %rax      # 0x103b8
movq %rcx, (%rax)
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopl (%rax)