// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: prv_find_first_stop_hex
static size_t prv_find_first_stop_hex(subtilis_parser_t *p,
				      subtilis_ir_operand_t str_data,
				      subtilis_ir_operand_t str_len,
				      subtilis_ir_operand_t end_str,
				      subtilis_ir_operand_t end_label,
				      subtilis_ir_operand_t *minus,
				      subtilis_error_t *err)
{
	subtilis_ir_operand_t skip_sign_label;
	subtilis_ir_operand_t first_end_label;
	subtilis_ir_operand_t op1;
	subtilis_ir_operand_t max_digit;
	subtilis_ir_operand_t condee;
	subtilis_ir_operand_t condee2;
	subtilis_ir_operand_t lta;
	subtilis_ir_operand_t gtf;
	size_t ptr;
	subtilis_ir_operand_t byte;

	skip_sign_label.label = subtilis_ir_section_new_label(p->current);
	first_end_label.label = subtilis_ir_section_new_label(p->current);

	max_digit.integer = '9';
	ptr = prv_find_first_stop_prolog(
	    p, str_data, str_len, max_digit, true, end_str, &byte,
	    skip_sign_label, first_end_label, end_label, minus, &condee, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	op1.integer = 32;
	byte.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_ORI_I32, byte, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	op1.integer = 'a';
	lta.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_LTI_I32, byte, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	op1.integer = 'f';
	gtf.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_GTI_I32, byte, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	condee2.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_OR_I32, lta, gtf, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	condee.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_EOR_I32, condee, condee2, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC_NF,
					  condee, skip_sign_label,
					  first_end_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	subtilis_ir_section_add_label(p->current, first_end_label.label, err);

	return ptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %r14
movq 0x48(%rdi), %rdi
callq 0x2d00a
movq %rax, %r12
movq 0x48(%r14), %rdi
callq 0x2d00a
subq $0x8, %rsp
leaq 0x18(%rsp), %r10
leaq 0x10(%rsp), %r9
movl $0x39, %edx
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %r15
movl $0x1, %ecx
movq %rbp, %r8
pushq %rbx
pushq %r10
pushq %r13
pushq %rax
pushq %r12
callq 0x34ea6
addq $0x30, %rsp
movq $-0x1, %r13
cmpl $0x0, (%rbx)
jne 0x354b0
movq %rax, 0x20(%rsp)
movq 0x48(%r14), %rdi
movq 0x8(%rsp), %rdx
movl $0x20, %ecx
movl $0x27, %esi
movq %rbx, %r8
callq 0x2c00f
movq %rax, 0x8(%rsp)
cmpl $0x0, (%rbx)
jne 0x354b0
movq %rax, %rbp
movq 0x48(%r14), %rdi
movl $0x61, %ecx
movl $0x3d, %esi
movq %rax, %rdx
movq %rbx, %r8
callq 0x2c00f
cmpl $0x0, (%rbx)
jne 0x354b0
movq %rax, 0x18(%rsp)
movq 0x48(%r14), %rdi
movl $0x66, %ecx
movl $0x35, %esi
movq %rbp, %rdx
movq %rbx, %r8
callq 0x2c00f
cmpl $0x0, (%rbx)
jne 0x354b0
movq 0x48(%r14), %rdi
movl $0x26, %esi
movq 0x18(%rsp), %rdx
movq %rax, %rcx
movq %rbx, %r8
callq 0x2c00f
cmpl $0x0, (%rbx)
jne 0x354b0
movq 0x48(%r14), %rdi
movq 0x10(%rsp), %rdx
movl $0x28, %esi
movq %rax, %rcx
movq %rbx, %r8
callq 0x2c00f
movq %rax, 0x10(%rsp)
cmpl $0x0, (%rbx)
jne 0x354b0
movq 0x48(%r14), %rdi
movl $0x44, %esi
movq %rax, %rdx
movq %r12, %rcx
movq %r15, %r8
movq %rbx, %r9
callq 0x2c0c2
cmpl $0x0, (%rbx)
jne 0x354b0
movq 0x48(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2d017
movq 0x20(%rsp), %r13
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq