// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/common/ir.c
// Function: prv_parse_operands
static const char *prv_parse_operands(const char *rule,
				      subtilis_ir_op_match_t *match,
				      subtilis_error_t *err)
{
	const int max_op = 32;
	char operand[max_op];
	size_t i;
	size_t j;
	const subtilis_ir_class_info_t *details;
	unsigned long num;
	const char *num_ptr;
	char *end_ptr = 0;
	subtilis_ir_label_match_t label;

	label.op_match = SUBTILIS_OP_MATCH_ANY;
	label.label = SIZE_MAX;

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

	for (j = 0; j < details->op_count; j++) {
		while (prv_is_white_space(rule))
			rule++;

		for (i = 0; *rule && i < max_op && !prv_is_white_space(rule);
		     i++) {
			if (*rule == ',') {
				rule++;
				break;
			}
			operand[i] = *rule++;
		}
		operand[i] = 0;
		if (!strcmp(operand, "*")) {
			match->op.instr.op_match[j] = SUBTILIS_OP_MATCH_ANY;
		} else if (!strncmp(operand, "label_", LABEL_STR_SIZE)) {
			if (details->classes[j] != SUBTILIS_IR_OPERAND_LABEL) {
				subtilis_error_set_assertion_failed(err);
				return NULL;
			}
			prv_parse_label(operand + LABEL_STR_SIZE, &label, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return NULL;
			match->op.instr.operands[j].label = label.label;
			match->op.instr.op_match[j] = label.op_match;
		} else if (operand[0] == '#') {
			if (details->classes[j] != SUBTILIS_IR_OPERAND_I32) {
				subtilis_error_set_assertion_failed(err);
				return NULL;
			}
			errno = 0;
			num = strtoul(operand + 1, &end_ptr, 10);
			if (*end_ptr != 0 || errno != 0 || num > INT_MAX) {
				subtilis_error_set_assertion_failed(err);
				return NULL;
			}
			match->op.instr.operands[j].integer = (int32_t)num;
			match->op.instr.op_match[j] = SUBTILIS_OP_MATCH_FIXED;
		} else if ((operand[0] == 'r') || (operand[0] == 'f')) {
			if ((operand[0] == 'r') &&
			    details->classes[j] !=
				SUBTILIS_IR_OPERAND_REGISTER) {
				subtilis_error_set_assertion_failed(err);
				return NULL;
			}
			if ((operand[0] == 'f') &&
			    details->classes[j] !=
				SUBTILIS_IR_OPERAND_FREGISTER) {
				subtilis_error_set_assertion_failed(err);
				return NULL;
			}
			num_ptr = operand + 1;
			if (operand[1] == 0) {
				subtilis_error_set_assertion_failed(err);
				return NULL;
			} else if (operand[1] == '_') {
				match->op.instr.op_match[j] =
				    SUBTILIS_OP_MATCH_FLOATING;
				num_ptr++;
			} else {
				match->op.instr.op_match[j] =
				    SUBTILIS_OP_MATCH_FIXED;
			}
			errno = 0;
			num = strtoul(num_ptr, &end_ptr, 10);
			if (*end_ptr != 0 || errno != 0 || num > INT_MAX) {
				subtilis_error_set_assertion_failed(err);
				return NULL;
			}
			match->op.instr.operands[j].reg = (int32_t)num;
		} else {
			/* Missing arguments on rule */

			subtilis_error_set_assertion_failed(err);
			return NULL;
		}
	}

	return rule;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x20, -0x24(%rbp)
movq %rsp, %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x0, -0x68(%rbp)
movq $-0x1, -0x70(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
leaq 0x8fbf4(%rip), %rax     # 0xcac90
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
leaq 0x6fb41(%rip), %rax     # 0xaabf0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x3b555
jmp 0x3b0d5
movq -0x10(%rbp), %rdi
callq 0x3af20
testb $0x1, %al
jne 0x3b0e4
jmp 0x3b0f2
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3b0d5
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xa1(%rbp)
je 0x3b12e
xorl %eax, %eax
cmpq $0x20, -0x38(%rbp)
movb %al, -0xa1(%rbp)
jae 0x3b12e
movq -0x10(%rbp), %rdi
callq 0x3af20
xorb $-0x1, %al
movb %al, -0xa1(%rbp)
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x3b13a
jmp 0x3b181
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x3b154
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3b181
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %cl
movq -0x38(%rbp), %rax
movb %cl, -0xa0(%rbp,%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x3b0fa
movq -0x38(%rbp), %rax
movb $0x0, -0xa0(%rbp,%rax)
leaq 0x74fca(%rip), %rsi     # 0xb015e
leaq -0xa0(%rbp), %rdi
callq 0x12140
cmpl $0x0, %eax
jne 0x3b1ba
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movl $0x0, 0x30(%rax,%rcx,4)
jmp 0x3b542
leaq -0xa0(%rbp), %rdi
leaq 0x700ff(%rip), %rsi     # 0xab2c7
movl $0x6, %edx
callq 0x12050
cmpl $0x0, %eax
jne 0x3b272
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpl $0x4, 0x8(%rax,%rcx,4)
je 0x3b218
movq -0x20(%rbp), %rdi
movl $0xf, %esi
leaq 0x6fc1e(%rip), %rdx     # 0xaae18
movl $0x572, %ecx            # imm = 0x572
callq 0x158e0
movq $0x0, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0x3b564
leaq -0xa0(%rbp), %rdi
addq $0x6, %rdi
movq -0x20(%rbp), %rdx
leaq -0x70(%rbp), %rsi
callq 0x3af80
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x3b24d
movq $0x0, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0x3b564
movq -0x70(%rbp), %rdx
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rdx, 0x10(%rax,%rcx,8)
movl -0x68(%rbp), %edx
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movl %edx, 0x30(%rax,%rcx,4)
jmp 0x3b540
movsbl -0xa0(%rbp), %eax
cmpl $0x23, %eax
jne 0x3b35c
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpl $0x2, 0x8(%rax,%rcx,4)
je 0x3b2bf
movq -0x20(%rbp), %rdi
movl $0xf, %esi
leaq 0x6fb77(%rip), %rdx     # 0xaae18
movl $0x57c, %ecx            # imm = 0x57C
callq 0x158e0
movq $0x0, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0x3b564
callq 0x12030
movl $0x0, (%rax)
leaq -0xa0(%rbp), %rdi
addq $0x1, %rdi
leaq -0x60(%rbp), %rsi
movl $0xa, %edx
callq 0x12220
movq %rax, -0x50(%rbp)
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x3b307
callq 0x12030
cmpl $0x0, (%rax)
jne 0x3b307
cmpq $0x7fffffff, -0x50(%rbp) # imm = 0x7FFFFFFF
jbe 0x3b335
movq -0x20(%rbp), %rdi
movl $0xf, %esi
leaq 0x6fb01(%rip), %rdx     # 0xaae18
movl $0x582, %ecx            # imm = 0x582
callq 0x158e0
movq $0x0, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0x3b564
movq -0x50(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movl %edx, 0x10(%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movl $0x1, 0x30(%rax,%rcx,4)
jmp 0x3b53e
movsbl -0xa0(%rbp), %eax
cmpl $0x72, %eax
je 0x3b378
movsbl -0xa0(%rbp), %eax
cmpl $0x66, %eax
jne 0x3b511
movsbl -0xa0(%rbp), %eax
cmpl $0x72, %eax
jne 0x3b3c1
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpl $0x0, 0x8(%rax,%rcx,4)
je 0x3b3c1
movq -0x20(%rbp), %rdi
movl $0xf, %esi
leaq 0x6fa75(%rip), %rdx     # 0xaae18
movl $0x58b, %ecx            # imm = 0x58B
callq 0x158e0
movq $0x0, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0x3b564
movsbl -0xa0(%rbp), %eax
cmpl $0x66, %eax
jne 0x3b40a
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpl $0x1, 0x8(%rax,%rcx,4)
je 0x3b40a
movq -0x20(%rbp), %rdi
movl $0xf, %esi
leaq 0x6fa2c(%rip), %rdx     # 0xaae18
movl $0x591, %ecx            # imm = 0x591
callq 0x158e0
movq $0x0, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0x3b564
leaq -0xa0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movsbl -0x9f(%rbp), %eax
cmpl $0x0, %eax
jne 0x3b453
movq -0x20(%rbp), %rdi
movl $0xf, %esi
leaq 0x6f9e3(%rip), %rdx     # 0xaae18
movl $0x596, %ecx            # imm = 0x596
callq 0x158e0
movq $0x0, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0x3b564
movsbl -0x9f(%rbp), %eax
cmpl $0x5f, %eax
jne 0x3b47d
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movl $0x2, 0x30(%rax,%rcx,4)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x3b48d
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movl $0x1, 0x30(%rax,%rcx,4)
jmp 0x3b48f
callq 0x12030
movl $0x0, (%rax)
movq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0xa, %edx
callq 0x12220
movq %rax, -0x50(%rbp)
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x3b4d0
callq 0x12030
cmpl $0x0, (%rax)
jne 0x3b4d0
cmpq $0x7fffffff, -0x50(%rbp) # imm = 0x7FFFFFFF
jbe 0x3b4fb
movq -0x20(%rbp), %rdi
movl $0xf, %esi
leaq 0x6f938(%rip), %rdx     # 0xaae18
movl $0x5a3, %ecx            # imm = 0x5A3
callq 0x158e0
movq $0x0, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0x3b564
movq -0x50(%rbp), %rax
movslq %eax, %rdx
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rdx, 0x10(%rax,%rcx,8)
jmp 0x3b53c
movq -0x20(%rbp), %rdi
movl $0xf, %esi
leaq 0x6f8f7(%rip), %rdx     # 0xaae18
movl $0x5aa, %ecx            # imm = 0x5AA
callq 0x158e0
movq $0x0, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0x3b564
jmp 0x3b53e
jmp 0x3b540
jmp 0x3b542
jmp 0x3b544
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x3b0c2
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rsp
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)