// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/6/ra.c
// Function: paint
static int
paint(Isel *s)
{
	int taken[Nreg];
	Loc *n, *w;
	regid l;
	size_t i, j;
	int spilled;
	int found;

	spilled = 0;
	while (s->nselstk) {
		memset(taken, 0, Nreg*sizeof(int));
		n = lpop(&s->selstk, &s->nselstk);

		for (j = 0; j < s->ngadj[n->reg.id];j++) {
			l = s->gadj[n->reg.id][j];
			if (debugopt['r'] > 1)
				printedge(stdout, "paint-edge:", n->reg.id, l);
			w = locmap[getalias(s, l)];
			if (w->reg.colour)
				taken[colourmap[w->reg.colour]] = 1;
		}

		found = 0;
		for (i = 0; i < Northogonal; i++) {
			if (regmap[i][n->mode] && !taken[i]) {
				n->reg.colour = regmap[i][n->mode];
				found = 1;
				break;
			}
		}
		if (!found) {
			spilled = 1;
			wlputset(s->spilled, n->reg.id);
		}
	}
	for (l = 0; bsiter(s->coalesced, &l); l++) {
		n = locmap[getalias(s, l)];
		locmap[l]->reg.colour = n->reg.colour;
	}
	return spilled;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x8(%rbp)
movl $0x0, -0x1cc(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x4a8(%rax)
je 0x132ab
leaq -0x1a0(%rbp), %rdi
xorl %esi, %esi
movl $0x198, %edx            # imm = 0x198
callq 0x6180
movq -0x8(%rbp), %rdi
addq $0x4a0, %rdi            # imm = 0x4A0
movq -0x8(%rbp), %rsi
addq $0x4a8, %rsi            # imm = 0x4A8
callq 0x48300
movq %rax, -0x1a8(%rbp)
movq $0x0, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x3c0(%rcx), %rcx
movq -0x1a8(%rbp), %rdx
movq 0x10(%rdx), %rdx
cmpq (%rcx,%rdx,8), %rax
jae 0x131d4
movq -0x8(%rbp), %rax
movq 0x3b8(%rax), %rax
movq -0x1a8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq -0x1c8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x1b8(%rbp)
leaq 0x69bdb(%rip), %rax     # 0x7cd00
movsbl 0x72(%rax), %eax
cmpl $0x1, %eax
jle 0x13156
movq 0x4be9b(%rip), %rax     # 0x5efd0
movq (%rax), %rdi
movq -0x1a8(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x1b8(%rbp), %rcx
leaq 0x3aca7(%rip), %rsi     # 0x4ddf8
callq 0x13740
leaq 0x69843(%rip), %rax     # 0x7c9a0
movq (%rax), %rax
movq %rax, -0x1d8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x1b8(%rbp), %rsi
callq 0x112a0
movq %rax, %rcx
movq -0x1d8(%rbp), %rax
movq (%rax,%rcx,8), %rax
movq %rax, -0x1b0(%rbp)
movq -0x1b0(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x131bb
movq -0x1b0(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %ecx
leaq 0x68b24(%rip), %rax     # 0x7bcd0
movslq (%rax,%rcx,4), %rax
movl $0x1, -0x1a0(%rbp,%rax,4)
jmp 0x131bd
movq -0x1c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c8(%rbp)
jmp 0x130cb
movl $0x0, -0x1d0(%rbp)
movq $0x0, -0x1c0(%rbp)
cmpq $0x1e, -0x1c0(%rbp)
jae 0x13278
leaq 0x68782(%rip), %rax     # 0x7b980
imulq $0x1c, -0x1c0(%rbp), %rcx
addq %rcx, %rax
movq -0x1a8(%rbp), %rcx
movl 0x4(%rcx), %ecx
cmpl $0x0, (%rax,%rcx,4)
je 0x1325f
movq -0x1c0(%rbp), %rax
cmpl $0x0, -0x1a0(%rbp,%rax,4)
jne 0x1325f
leaq 0x6874f(%rip), %rax     # 0x7b980
imulq $0x1c, -0x1c0(%rbp), %rcx
addq %rcx, %rax
movq -0x1a8(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl (%rax,%rcx,4), %ecx
movq -0x1a8(%rbp), %rax
movl %ecx, 0x18(%rax)
movl $0x1, -0x1d0(%rbp)
jmp 0x13278
jmp 0x13261
movq -0x1c0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c0(%rbp)
jmp 0x131e9
cmpl $0x0, -0x1d0(%rbp)
jne 0x132a6
movl $0x1, -0x1cc(%rbp)
movq -0x8(%rbp), %rax
movq 0x4b8(%rax), %rdi
movq -0x1a8(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x13fc0
jmp 0x13079
movq $0x0, -0x1b8(%rbp)
movq -0x8(%rbp), %rax
movq 0x4b0(%rax), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x48860
cmpl $0x0, %eax
je 0x13341
leaq 0x696c7(%rip), %rax     # 0x7c9a0
movq (%rax), %rax
movq %rax, -0x1e0(%rbp)
movq -0x8(%rbp), %rdi
movq -0x1b8(%rbp), %rsi
callq 0x112a0
movq %rax, %rcx
movq -0x1e0(%rbp), %rax
movq (%rax,%rcx,8), %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rax
movl 0x18(%rax), %ecx
leaq 0x69687(%rip), %rax     # 0x7c9a0
movq (%rax), %rax
movq -0x1b8(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x18(%rax)
movq -0x1b8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1b8(%rbp)
jmp 0x132b6
movl -0x1cc(%rbp), %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq