// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/evaluate.c
// Function: parse_asm_constraint
static void parse_asm_constraint(struct asm_operand *op)
{
	struct expression *constraint = op->constraint;
	const char *str = constraint->string->data;
	int c;

	switch (str[0]) {
	case '\0':
		sparse_error(constraint->pos, "invalid ASM constraint (\"\")");
		break;
	case '+':
		op->is_modify = true;
		/* fall-through */
	case '=':
		op->is_assign = true;
		str++;
		break;
	}

	while ((c = *str++)) {
		switch (c) {
		case '=':
		case '+':
			sparse_error(constraint->pos, "invalid ASM constraint '%c'", c);
			break;

		case '&':
			op->is_earlyclobber = true;
			break;
		case '%':
			op->is_commutative = true;
			break;
		case 'r':
			op->is_register = true;
			break;

		case 'm':
		case 'o':
		case 'V':
		case 'Q':
			op->is_memory = true;
			break;

		case '<':
		case '>':
			// FIXME: ignored for now
			break;

		case ',':
			// FIXME: multiple alternative constraints
			break;

		case '0' ... '9':
			// FIXME: numeric  matching constraint?
			break;
		case '[':
			// FIXME: symbolic matching constraint
			return;

		default:
			if (arch_target->asm_constraint)
				str = arch_target->asm_constraint(op, c, str);

			// FIXME: multi-letter constraints
			break;
		}
	}

	// FIXME: how to deal with multi-constraint?
	if (op->is_register)
		op->is_memory = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
addq $0x4, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x20(%rbp)
testl %eax, %eax
je 0x5572c
jmp 0x55718
movl -0x20(%rbp), %eax
subl $0x2b, %eax
je 0x55744
jmp 0x55722
movl -0x20(%rbp), %eax
subl $0x3d, %eax
je 0x55754
jmp 0x55770
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x17027(%rip), %rsi     # 0x6c762
movb $0x0, %al
callq 0x16f90
jmp 0x55770
movq -0x8(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x3, %cl
orb $0x2, %cl
movb %cl, 0x18(%rax)
movq -0x8(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x18(%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x55772
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movsbl (%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
je 0x5585e
movl -0x1c(%rbp), %eax
addl $-0x25, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x4d, %eax
ja 0x55827
movq -0x28(%rbp), %rax
leaq 0x1602c(%rip), %rcx     # 0x6b7dc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %edx
movq 0x8(%rax), %rdi
leaq 0x16fb3(%rip), %rsi     # 0x6c77e
movb $0x0, %al
callq 0x16f90
jmp 0x55859
movq -0x8(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x5, %cl
orb $0x4, %cl
movb %cl, 0x18(%rax)
jmp 0x55859
movq -0x8(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x9, %cl
orb $0x8, %cl
movb %cl, 0x18(%rax)
jmp 0x55859
movq -0x8(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x11, %cl
orb $0x10, %cl
movb %cl, 0x18(%rax)
jmp 0x55859
movq -0x8(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x21, %cl
orb $0x20, %cl
movb %cl, 0x18(%rax)
jmp 0x55859
jmp 0x55859
jmp 0x55859
jmp 0x55859
jmp 0x55882
leaq 0x34ee2(%rip), %rax     # 0x8a710
movq (%rax), %rax
cmpq $0x0, 0x68(%rax)
je 0x55857
leaq 0x34ed1(%rip), %rax     # 0x8a710
movq (%rax), %rax
movq 0x68(%rax), %rax
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x18(%rbp), %rdx
callq *%rax
movq %rax, -0x18(%rbp)
jmp 0x55859
jmp 0x55772
movq -0x8(%rbp), %rax
movb 0x18(%rax), %al
shrb $0x4, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x55882
movq -0x8(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x21, %cl
orb $0x0, %cl
movb %cl, 0x18(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)