// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/6/ra.c
// Function: uses
static size_t
uses(Insn *insn, regid *u)
{
	size_t i, j;
	int k;
	Loc *m;

	j = 0;
	/* Add all the registers used and defined. Duplicate
	 * in this list are fine, since they're being added to
	 * a set anyways */
	for (i = 0; i < Maxarg; i++) {
		if (!usetab[insn->op].l[i])
			break;
		k = usetab[insn->op].l[i] - 1;
		/* non-registers are handled later */
		if (insn->args[k]->type == Locreg)
			if (!isfixreg(insn->args[k]))
				u[j++] = insn->args[k]->reg.id;
	}
	/* some insns don't reflect their defs in the args.
	 * These are explictly listed in the insn description */
	for (i = 0; i < Nreg; i++) {
		if (!usetab[insn->op].r[i])
			break;
		/* not a leak; physical registers get memoized */
		u[j++] = locphysreg(usetab[insn->op].r[i])->reg.id;
	}
	/* If the registers are in an address calculation,
	 * they're used no matter what. */
	for (i = 0; i < insn->nargs; i++) {
		m = insn->args[i];
		if (m->type != Locmem && m->type != Locmeml)
			continue;
		if (m->mem.base)
			if (!isfixreg(m->mem.base))
				u[j++] = m->mem.base->reg.id;
		if (m->mem.idx)
			if (!isfixreg(m->mem.base))
				u[j++] = m->mem.idx->reg.id;
	}
	return j;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x4, -0x18(%rbp)
jae 0x13c01
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
leaq 0x4c865(%rip), %rax     # 0x603c0
imulq $0x338, %rcx, %rcx      # imm = 0x338
addq %rcx, %rax
movq -0x18(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x13b74
jmp 0x13c01
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
leaq 0x4c83c(%rip), %rax     # 0x603c0
imulq $0x338, %rcx, %rcx      # imm = 0x338
addq %rcx, %rax
movq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rax
cmpl $0x2, (%rax)
jne 0x13bee
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rdi
callq 0x13f80
cmpl $0x0, %eax
jne 0x13bec
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rax
movq 0x10(%rax), %rdx
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x20(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x13bee
jmp 0x13bf0
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x13b40
movq $0x0, -0x18(%rbp)
cmpq $0x66, -0x18(%rbp)
jae 0x13c94
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
leaq 0x4c79c(%rip), %rax     # 0x603c0
imulq $0x338, %rcx, %rcx      # imm = 0x338
addq %rcx, %rax
movq -0x18(%rbp), %rcx
cmpl $0x0, 0x19c(%rax,%rcx,4)
jne 0x13c3e
jmp 0x13c94
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
leaq 0x4c772(%rip), %rax     # 0x603c0
imulq $0x338, %rcx, %rcx      # imm = 0x338
addq %rcx, %rax
movq -0x18(%rbp), %rcx
movl 0x19c(%rax,%rcx,4), %edi
callq 0xffc0
movq 0x10(%rax), %rdx
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x20(%rbp)
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x13c09
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jae 0x13d6d
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x3, (%rax)
je 0x13cd6
movq -0x30(%rbp), %rax
cmpl $0x4, (%rax)
je 0x13cd6
jmp 0x13d5c
movq -0x30(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x13d18
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x13f80
cmpl $0x0, %eax
jne 0x13d16
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rdx
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x20(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x13d18
movq -0x30(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x13d5a
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x13f80
cmpl $0x0, %eax
jne 0x13d58
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x10(%rax), %rdx
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x20(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x13d5a
jmp 0x13d5c
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x13c9c
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)