// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/common/ir.c
// Function: prv_match_op
static bool prv_match_op(subtilis_ir_op_t *op, subtilis_ir_op_match_t *match,
			 subtilis_ir_match_state_t *state,
			 subtilis_error_t *err)
{
	size_t j;
	subtilis_ir_inst_t *instr;
	subtilis_ir_inst_match_t *match_instr;
	const subtilis_ir_class_info_t *details;

	if (op->type != match->type)
		return false;
	if (prv_is_call(op))
		return true;
	if (op->type == SUBTILIS_OP_SYS_CALL)
		return true;
	if (op->type == SUBTILIS_OP_LABEL)
		return prv_process_floating_label(state, op->op.label,
						  match->op.label.label, err);

	instr = &op->op.instr;
	match_instr = &match->op.instr;
	if (instr->type != match_instr->type)
		return false;

	details = &class_details[op_desc[match->op.instr.type].cls];

	for (j = 0; j < details->op_count; j++) {
		if (match_instr->op_match[j] == SUBTILIS_OP_MATCH_ANY)
			continue;
		if (match_instr->op_match[j] == SUBTILIS_OP_MATCH_FIXED) {
			switch (details->classes[j]) {
			case SUBTILIS_IR_OPERAND_FREGISTER:
			case SUBTILIS_IR_OPERAND_REGISTER:
				if (match_instr->operands[j].reg ==
				    instr->operands[j].reg)
					continue;
				break;
			case SUBTILIS_IR_OPERAND_I32:
				if (match_instr->operands[j].integer ==
				    instr->operands[j].integer)
					continue;
				break;
			case SUBTILIS_IR_OPERAND_REAL:
				if (match_instr->operands[j].real ==
				    instr->operands[j].real)
					continue;
				break;
			default:
				subtilis_error_set_assertion_failed(err);
				return false;
			}
			return false;
		}
		switch (details->classes[j]) {
		case SUBTILIS_IR_OPERAND_REGISTER:
			if (prv_process_floating_reg(
				state, instr->operands[j].reg,
				match_instr->operands[j].reg, err))
				continue;
			break;
		case SUBTILIS_IR_OPERAND_FREGISTER:
			if (prv_process_floating_freg(
				state, instr->operands[j].reg,
				match_instr->operands[j].reg, err))
				continue;
			break;
		case SUBTILIS_IR_OPERAND_LABEL:
			if (prv_process_floating_label(
				state, instr->operands[j].label,
				match_instr->operands[j].label, err))
				continue;
			break;
		default:
			subtilis_error_set_assertion_failed(err);
			return false;
		}
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
je 0x3a75f
movb $0x0, -0x1(%rbp)
jmp 0x3aa17
movq -0x10(%rbp), %rdi
callq 0x3aae0
testb $0x1, %al
jne 0x3a76e
jmp 0x3a777
movb $0x1, -0x1(%rbp)
jmp 0x3aa17
movq -0x10(%rbp), %rax
cmpl $0x8, (%rax)
jne 0x3a789
movb $0x1, -0x1(%rbp)
jmp 0x3aa17
movq -0x10(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x3a7b9
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x28(%rbp), %rcx
callq 0x3b580
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x3aa17
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
cmpl (%rcx), %eax
je 0x3a7e8
movb $0x0, -0x1(%rbp)
jmp 0x3aa17
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
leaq 0x90498(%rip), %rax     # 0xcac90
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
leaq 0x703e5(%rip), %rax     # 0xaabf0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x48(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x3aa13
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpl $0x0, 0x28(%rax,%rcx,4)
jne 0x3a843
jmp 0x3aa02
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpl $0x1, 0x28(%rax,%rcx,4)
jne 0x3a917
movq -0x48(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x8(%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
subl $0x2, %eax
jb 0x3a880
jmp 0x3a86c
movl -0x4c(%rbp), %eax
subl $0x2, %eax
je 0x3a8a3
jmp 0x3a876
movl -0x4c(%rbp), %eax
subl $0x3, %eax
je 0x3a8c4
jmp 0x3a8eb
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rdx
cmpq 0x8(%rcx,%rdx,8), %rax
jne 0x3a8a1
jmp 0x3aa02
jmp 0x3a90e
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x8(%rax,%rcx,8), %eax
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rdx
cmpl 0x8(%rcx,%rdx,8), %eax
jne 0x3a8c2
jmp 0x3aa02
jmp 0x3a90e
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
movsd 0x8(%rax,%rcx,8), %xmm0
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
ucomisd 0x8(%rax,%rcx,8), %xmm0
jne 0x3a8e9
jp 0x3a8e9
jmp 0x3aa02
jmp 0x3a90e
movq -0x28(%rbp), %rdi
movl $0xf, %esi
leaq 0x7051d(%rip), %rdx     # 0xaae18
movl $0x6a4, %ecx            # imm = 0x6A4
callq 0x158e0
movb $0x0, -0x1(%rbp)
jmp 0x3aa17
movb $0x0, -0x1(%rbp)
jmp 0x3aa17
movq -0x48(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x8(%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
testl %eax, %eax
je 0x3a943
jmp 0x3a92c
movl -0x50(%rbp), %eax
subl $0x1, %eax
je 0x3a97a
jmp 0x3a936
movl -0x50(%rbp), %eax
subl $0x4, %eax
je 0x3a9ab
jmp 0x3a9dc
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rsi
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rdx
movq -0x28(%rbp), %rcx
callq 0x3b6b0
testb $0x1, %al
jne 0x3a970
jmp 0x3a975
jmp 0x3aa02
jmp 0x3a9fc
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rsi
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rdx
movq -0x28(%rbp), %rcx
callq 0x3b7d0
testb $0x1, %al
jne 0x3a9a7
jmp 0x3a9a9
jmp 0x3aa02
jmp 0x3a9fc
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rsi
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rdx
movq -0x28(%rbp), %rcx
callq 0x3b580
testb $0x1, %al
jne 0x3a9d8
jmp 0x3a9da
jmp 0x3aa02
jmp 0x3a9fc
movq -0x28(%rbp), %rdi
movl $0xf, %esi
leaq 0x7042c(%rip), %rdx     # 0xaae18
movl $0x6bd, %ecx            # imm = 0x6BD
callq 0x158e0
movb $0x0, -0x1(%rbp)
jmp 0x3aa17
movb $0x0, -0x1(%rbp)
jmp 0x3aa17
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x3a81e
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)