	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib9000_mbx_fetch_to_cache
_dib9000_mbx_fetch_to_cache:            ## @dib9000_mbx_fetch_to_cache
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_DIB9000_MSG_CACHE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_6
## %bb.1:
	movl	%esi, %ecx
	movq	%rdi, %r14
	movq	(%rdi), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rdx,%rsi,8), %rbx
	cmpl	$0, (%rbx)
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rsi
	cmpq	%rsi, %rax
	jne	LBB0_3
LBB0_6:
	leaq	L_.str(%rip), %rdi
	callq	_dprintk
	movl	$-1, %r15d
	jmp	LBB0_7
LBB0_4:
	movl	$1, %r15d
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_dib9000_mbx_read
	movl	$-256, %ecx
	andl	(%rbx), %ecx
	cmpl	$32768, %ecx                    ## imm = 0x8000
	jne	LBB0_7
## %bb.5:
	leaq	4(%rbx), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dib9000_risc_debug_buf
	movl	$0, (%rbx)
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DIB9000_MSG_CACHE_SIZE,4,2     ## @DIB9000_MSG_CACHE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MBX: no free cache-slot found for new message...\n"

	.no_dead_strip	_dib9000_mbx_fetch_to_cache
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib9000_mbx_fetch_to_cache
_dib9000_mbx_fetch_to_cache:            ; @dib9000_mbx_fetch_to_cache
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _DIB9000_MSG_CACHE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DIB9000_MSG_CACHE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x3, x1
	mov	x19, x0
	ldr	x9, [x0]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x20, [x9]
	ldr	w10, [x20]
	cbz	w10, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x9, x9, #8
	subs	x8, x8, #1
	b.ne	LBB0_2
LBB0_4:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
	mov	w21, #-1
	b	LBB0_7
LBB0_5:
	mov	w21, #1
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_dib9000_mbx_read
	ldr	w8, [x20]
	and	w8, w8, #0xffffff00
	cmp	w8, #8, lsl #12                 ; =32768
	b.ne	LBB0_7
; %bb.6:
	mov	x2, x0
	add	x1, x20, #4
	mov	x0, x19
	bl	_dib9000_risc_debug_buf
	str	wzr, [x20]
	mov	w21, #1
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DIB9000_MSG_CACHE_SIZE,4,2     ; @DIB9000_MSG_CACHE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MBX: no free cache-slot found for new message...\n"

	.no_dead_strip	_dib9000_mbx_fetch_to_cache
.subsections_via_symbols
