	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ringbuf_findchr                ## -- Begin function ringbuf_findchr
	.p2align	4, 0x90
_ringbuf_findchr:                       ## @ringbuf_findchr
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_ringbuf_end
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_ringbuf_bytes_used
	movq	%rax, %r15
	cmpq	%r12, %rax
	jbe	LBB0_8
## %bb.1:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	(%rbx), %r14
	movq	8(%rbx), %rbx
	subq	%r14, %rbx
	sarq	$2, %rbx
	addq	%r12, %rbx
	callq	_ringbuf_buffer_size
	movl	%eax, %ecx
	movslq	%eax, %rsi
	movq	%rbx, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%r14,%rdx,4), %r14
	xorl	%edi, %edi
	subq	%r14, %r13
	seta	%dil
	callq	_lwIP_ASSERT
	shrq	$2, %r13
	subq	%r12, %r15
	movl	%r13d, %edi
	movq	%r15, %rsi
	callq	_LWIP_MIN
	movq	%rax, %rbx
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%rax, %rdx
	callq	_memchr
	testq	%rax, %rax
	jne	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	addq	%rbx, %r12
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_ringbuf_end
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_ringbuf_bytes_used
	movq	%rax, %r15
	cmpq	%r12, %rax
	ja	LBB0_3
	jmp	LBB0_8
LBB0_7:
	movq	%rax, %r15
	subq	%r14, %r15
	sarq	$2, %r15
	addq	%r12, %r15
LBB0_8:
	movq	%r15, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ringbuf_findchr                ; -- Begin function ringbuf_findchr
	.p2align	2
_ringbuf_findchr:                       ; @ringbuf_findchr
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	bl	_ringbuf_end
	mov	x23, x0
	mov	x0, x21
	bl	_ringbuf_bytes_used
	mov	x22, x0
	cmp	x0, x19
	b.ls	LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldp	x24, x8, [x21]
	sub	x8, x8, x24
	add	x25, x19, x8, asr #2
	mov	x0, x21
	bl	_ringbuf_buffer_size
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	udiv	x9, x25, x8
	msub	x8, x9, x8, x25
	add	x24, x24, x8, lsl #2
	subs	x23, x23, x24
	cset	w0, hi
	bl	_lwIP_ASSERT
	lsr	x0, x23, #2
	sub	x1, x22, x19
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_LWIP_MIN
	mov	x22, x0
	mov	x0, x24
	mov	x1, x20
	mov	x2, x22
	bl	_memchr
	cbnz	x0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	add	x19, x22, x19
	mov	x0, x21
	b	LBB0_1
LBB0_4:
	sub	x8, x0, x24
	add	x22, x19, x8, asr #2
LBB0_5:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
